User Profiles

Attributes

id (read-only) Unique ID for UserProfile in our system.
first_name First name of this user.
last_name Last name of this user.
email Email of this user.
nick_name (read-only) User nick name of this user, used for setting alert option.
country_code Country code of this user’s phone number.
role (read-only) Users role level within the account.
role_text (read-only) Users role title.
phone_number Phone number of this user.
url (read-only) The URL to get more information about this item.
is_account_owner (read-only) Whether this user profile is the owner of the account.
is_account_manager (read-only) Whether this user profile is a manager of the account.
avatar_url (read-only) The URL to the users avatar.

Available APIs

/api/users/

Lists all available user profiles or creates a new one. See above for the attributes each user profile has.

GET

Return a list of user profiles. It takes email address as a filter which will get information of specific user.

Arguments

  • limit (optional, default:2500, max:2500) – Sets the page size to a limit set by the user.
  • page (optional, default:0) – Retrieve the specific page of data of size limit.
  • email (option, String) – email address as the filter.

Argument Examples

  • limit=10 – will get the first page of the first 10 items.
  • limit=25&page=3 – will get the 4th page of size 25 items.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/users/
{
    "pagination": {
        "count": 28, 
        "next": null, 
        "previous": null
    }, 
    "data": [
        {
            "id": 13120, 
            "first_name": "john", 
            "last_name": "doe", 
            "nick_name": "", 
            "email": "null@appfirst.com", 
            "phone_number": null, 
            "country_code": null, 
            "role": 3, 
            "role_text": "Regular", 
            "is_account_owner": false, 
            "is_account_manager": false, 
            "avatar_url": "/static/v5/img/add_avatar_icon.svg", 
            "url": "/api/v5/users/13120/"
        }, 
        {
            "id": 8268, 
            "first_name": "jane", 
            "last_name": "doe", 
            "nick_name": "", 
            "email": "null1@appfirst.com", 
            "phone_number": 9522219840, 
            "country_code": 1, 
            "role": 2, 
            "role_text": "Manager", 
            "is_account_owner": false, 
            "is_account_manager": true, 
            "avatar_url": "/api/v5/users/", 
            "url": "/api/v5/users/8268/"
        }, 

POST

Create a new user profile for this tenant.

Arguments

  • first_name (required, String, length:1-30) – the first name of the new user profile.
  • last_name (required, String, length:1-30) – the last name of the new user profile.
  • email (required, String) – email address of this profile, it must be unique for each user profile. A valid email format is required. Once the user is successfully created, a confirmation email will be sent to the new user.
  • country_code (required, int) – ISO country code for this user’s phone, required for sending SMS message.
  • phone_number (required, int) – phone number of this user, required for sending SMS message.
curl --user {EMAIL}:{API_KEY} -d "email=new_user@gmail.com&country_code=1&phone_number=1234567890&first_name=Batman&last_name=Spiderman" https://wwws.appfirst.com/api/users/
{
    "phone_number": 1234567890,
    "is_account_owner": true,
    "first_name": "Batman",
    "last_name": "Spiderman",
    "nick_name": Peter,
    "id": 1,
    "country_code": 1,
    "email": "new_user@gmail.com",
    "url": "/api/v5/users/4/"
}

/api/users/{id}/

View, update, or delete a user profile.

GET

Get info about this user profile. It takes no additional parameters.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/users/1/
 
{
    "id": 13120, 
    "first_name": "john", 
    "last_name": "doe", 
    "nick_name": "", 
    "email": "null@appfirst.com", 
    "phone_number": null, 
    "country_code": null, 
    "role": 3, 
    "role_text": "Regular", 
    "is_account_owner": false, 
    "is_account_manager": false, 
    "avatar_url": "https://wwws.appfirst.com/static/v5/img/add_avatar_icon.svg", 
    "url": "/api/v5/users/13120/"
}

PUT

Update the information of this user. See User Profile creation for parameters.

curl --user {EMAIL}:{API_KEY} -X PUT -d "first_name=Batman" https://wwws.appfirst.com/api/users/1/
{
    "id": 13120, 
    "first_name": "Batman", 
    "last_name": "doe", 
    "nick_name": "", 
    "email": "null@appfirst.com", 
    "phone_number": null, 
    "country_code": null, 
    "role": 3, 
    "role_text": "Regular", 
    "is_account_owner": false, 
    "is_account_manager": false, 
    "avatar_url": "/v5/img/add_avatar_icon.svg", 
    "url": "/api/v5/users/13120/"
}

DELETE

Delete a user profile. Account owner can NOT be deleted.

curl --user {EMAIL}:{API_KEY} -X DELETE https://wwws.appfirst.com/api/users/1/