Top

Users

Get Users
GET /app/api/account/:account_id/users/
Returns information about users in the API caller account or one of its subaccounts.
Post user
POST /app/api/account/users/
Creates a new user and adds it to the API caller account or one of its subaccounts.
Put user
PUT /app/api/account/users/
Updates information about existing membership of the user in the API caller account or one of its subaccounts.
Delete user
DELETE /app/api/account/:account_id/users/:user_id
Removes the user from the API caller account or one of its subaccounts.
Get user tags
GET /app/api/user/tags/:account_id/:user_id
Retrieves list of tags associated with the existing user within the context of given account.
Post user tags
POST /app/api/user/tags/:account_id/:user_id
Associates tags with the existing user. New account tags are created if needed.
Delete user tags
DELETE /app/api/user/tags/:account_id/:user_id?tags=:tags
Removes association of given tags with the existing user.

Get User Information

GET  /app/api/account/:account_id/users/

Returns information about users in the API caller account or one of its subaccounts.

Response: JSON array

user_id int (12)
Returns user by id.
name string (255)
Returns user name (nick).
email string (255)
Returns user email (login).
role int (11)
Returns role in the account. [owner | manager | member]
category string (255)
Returns account membership category.
stub string (255)
Returns custom 'stub' part of the user invite URL.
created_date string
Returns user creation timestamp [yyyy-mm-dd hh:mm:ss].
last_visited string
Returns the last time the user visited the PeopleKeys application [yyyy-mm-dd hh:mm:ss].
region string (255)
Returns user geographic region.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
[
    {
      "user_id": "8675",
      "name": "John Smith",
      "email": "johnsmith@peoplekeys.com",
      "role": "4",
      "category": "Recruiting",
      "stub": "peoplekeys-recruiting",
      "created_date": 2015-01-15 00:09:30,
      "last_visited": 2015-01-15 00:10:37,
      "region": "en_US"
    },
    ...
]


Post User Information

POST  /app/api/account/users/

Creates a new user and adds it to the API caller account or one of its subaccounts.

HTTP Form Parameters

account_id int (12)
ID of the account to add the new user to.
role int (11)
user role in the account. [owner | manager | member]
category string (255)
Account membership category.
name string (255)
new user name (nick).
email string (255)
new user email (login).
password string or hash??? (??)
new user password.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8

    {
      "account_id": "12345",
      "role": "4",
      "category": "Recruiting",
      "name": "John Smith",
      "email": "johnsmith@peoplekeys.com",
      "password": "string or hash???"
    }


Put User Information

PUT  /app/api/account/users/

Updates information about existing membership of the user in the API caller account or one of its subaccounts.

HTTP Form Parameters

account_id int (12)
ID of the account.
user_id int (12)
ID of the user.
role int (11)
user role in the account. [owner | manager | member]
category string (255)
[optional] account membership category.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8

    {
      "account_id": "12345",
      "user_id": "8675",
      "role": "4",
      "category": "Recruiting"
    }


Delete User Information

DELETE  /app/api/account/:account_id/users/:user_id

Removes the user from the API caller account or one of its subaccounts.

HTTP GET Parameters

account_id int (12)
ID of the account to delete.
user_id int (12)
ID of the user.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8

    {
      "account_id": "12345",
      "user_id": "8675"  
    }


Get User Tags

GET  /app/api/user/tags/:account_id/:user_id

Retrieves list of tags associated with the existing user within the context of given account.

HTTP URL Parameters

account_id int (12)
ID of the account. Tags are looked up within the context of this account.
User_id int (12)
ID of the user.

Response - JSON Array

tag_list String (?)
list of tags associated with the user record within given account.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8
{
    tag_list = [...]
}


Post User Tags

POST  /app/api/user/tags/:account_id/:user_id

Associates tags with the existing user. New account tags are created if needed.

HTTP URL Parameters

account_id int (12)
ID of the account. Tags are looked up within the context of this account.
User_id int (12)
ID of the user.

HTTP FORM Parameters

tag_list String (?)
list of tags to be associated with the user record.

Response - JSON Array

tags_affected String (?)
number of listed tags associated with the user.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8

    {
      "tags_affected 
    }


Delete User Tags

DELETE  /app/api/user/tags/:account_id/:user_id?tags=:tags

Removes association of given tags with the existing user.

HTTP URL Parameters

account_id int (12)
ID of the account. Tags are looked up within the context of this account.
User_id int (12)
ID of the user.

HTTP GET Parameters

tags JSON array
{
    tag_list = [...]
}
tag_list String (?)
list of tags to be removed from association with the user record.

Response - JSON Array

tags_affected String (?)
number of listed tags associated with the user.

Sample Response


Status: 200 OK
Content Type: application/json;charset=UTF-8

    {
      "tags_affected 
    }