The AgencyAnalytics API v3 is now deprecated. Support for this API will end July 1st, 2023.

Users

Authorize a User

Generates a grant for the given user.

Arguments

id required integer (32)

The ID of the user to authorize

Endpoint

GET /v3/users/:id/loginGrant

Response

json
 {
  "metadata": {
    "total_pages": 1,
    "total_records": 1
  },
  "data": {
    "token": "tkn.7bf94c2ks9f2e7d86174a4b3fc01c5ae",
    "time": "2015-04-13 16:34:57",
    "login_url": "http:\/\/test.clientseoreport.com\/v2\/#login-token\/99\/tkn.c6e1768b8e01ddwq2461ace8886b",
    "user_id": 123,
    "origin_user_id": 48
  }
}

Create a User

Creates a new user. Users have different roles which determine how they will access campaigns and other features.

Arguments

first_name required string

First name of the user

last_name required string

Last name of the user

username required string

Unique identifier of the user, used to login

password required string

Initial password for the user, used to login

email string

The user's primary email address

role required string

The type of user, such as "client"

email_credentials string

Creates a new user. Users have different roles which determine how they will access campaigns and other features.

Endpoint

POST /v3/users

Response

json
 {
  "metadata": {
    "total_pages": 1,
    "total_records": 1
  },
  "data": {
    "id": 123,
    "date_created": "2015-03-30 10:06:24",
    "email": "JDoe@test.com",
    "username": "JDoe@test.com",
    "first_name": "John",
    "last_name": "Doe",
    "role": "client",
    "campaign_access": "restricted",
    "account_id": 1
  }
}

Retrieve a User

Retrieves a single user with the given ID.

Arguments

id required integer (32)

The ID of the user to retrieve.

Endpoint

GET /v3/users/:id

Response

json
 {
  "metadata": {
    "total_pages": 1,
    "total_records": 1
  },
  "data": {
    "id": 123,
    "date_created": "2015-03-30 10:06:24",
    "email": "JDoe@test.com",
    "username": "JDoe@test.com",
    "password": null,
    "first_name": "John",
    "last_name": "Doe",
    "role": "client",
    "campaign_access": "restricted",
    "account_id": 1
  }
}

Update a User

Updates an existing user with the given id. Returns the modified user object upon success.

Arguments

id required integer (32)

The ID of the user to update.

first_name string

The first name of the user

last_name string

The last name of the user

username string

A globally unique name to identify the user. This field is visible and can be used to login.

email string

The primary email address of the user

password string

The password the user will use to login

role string

The type of user

Endpoint

PUT /v3/users/:id

Response

json
 {
  "metadata": {
    "total_pages": 1,
    "total_records": 1
  },
  "data": {
    "id": 123,
    "date_created": "2015-03-30 10:06:24",
    "email": "JDoe@test.com",
    "username": "JDoe@test.com",
    "first_name": "John",
    "last_name": "Doe",
    "role": "client",
    "campaign_access": "restricted",
    "account_id": 1
  }
}

List all Users

Returns an array containing users which have been created under the current account.

Arguments

filter string

search of user

page integer (32)

The page of records to return

limit integer (32)

Number of records to return

order_by string

Field to order results by

order_direction string

The direction to perform sort in

role array of strings

Roles to filter the results by

Endpoint

GET /v3/users

Response

json
 {
  "metadata": {
    "total_pages": 1,
    "total_records": 1
  },
  "data": [
    {
      "id": 123,
      "date_created": "2015-03-30 10:06:24",
      "email": "JDoe@test.com",
      "username": "JDoe@test.com",
      "password": null,
      "first_name": "John",
      "last_name": "Doe",
      "role": "client",
      "campaign_access": "restricted",
      "account_id": 1
    }
  ]
}

Delete a User

Deletes the user with the given id. This endpoint returns HTTP 204 No Content when the user is successfully deleted.

Arguments

id required integer (32)

The ID of the user to delete.

Endpoint

DELETE /v3/users/:id