Users

ĀLO supports two types of users:

  1. Users with a mobile phone number (mobile phone number, password, and second factor required to login)

  2. Device users where the login is tied to a device ID that is unique to each device

Get All Users

Get information about all team users.

GET /users

Pagination

The maximum number of users that will be returned in a single request is 100. If there are more than 100 users you can specify a page parameter great than 1 to get more data. The response will contain information about how many pages of data are available.

Query Parameters

Parameter

Default

Description

page

1

Specifies which page of results to return

per_page

100

Specifies maximum number of users to return in a given request. The maximum you can specify is 100.

include_inactive

false

When true the response will contain users that have been marked inactive

phone_number[]

none

This allows you to filter the list of user by user phone number.

Phone numbers must not contains spaces. They must also start with "+" (url encoded) and the country code. For example: %2B12031231234

You may provide multiple numbers like so: phone_number[]=%2B18601231234&phone_number[]=%2B12033214321

device_id[]

none

This allows you to filter the list of users by the user device id. You may provide multiple device ids like so: device_id[]=12345&device_id[]=5431

When filtering it is recommended to make separate requests for users filtered by phone number or device_id. If using both filters at the same time you will only get users that match both phone number and device id.

Success Response

A successful response will have an HTTP status of 200

Response Properties

Property

Description

page

Current page number of data returned

per_page

Maximum number of users returned per page

total_pages

Number of pages of data available

response_count

The number of users that were returned from the given request

total_count

Total number of users that are available

users

Collection of users

Example response

The sample response below indicates that you have received the second page of results. There are 2 pages available. The current page contains 21 of the total 121 users.

{
    "page": 2,
    "per_page": 100,
    "total_pages": 2,
    "response_count": 21,
    "total_count": 121,
    "users": [
      {...},
      {...}
    ]
}

Create User

Create a user for your team. When you create a user you can decide if they will login via a mobile phone number or a registered device id.

If the specified phone number or device id is already associated with an ĀLO user then the existing user will simply be added to you team.

If the user already exists the create request will not change the user's first_name and last_name. You must use the PUT /users/{user-id} to change their name.

POST /users

Body Parameters

Parameter

Required

Default

Description

login_type

Yes

For mobile phone logins use: "PHONE_NUMBER". For registered device id logins use: "DEVICE"

name

Yes (for Device Logins)

Name of the device

first_name

Yes (for Phone Logins)

First name of a phone login user

last_name

Yes (for Phone Logins)

Last name of phone login user.

phone_number

Yes (for Phone Logins)

Phone number starting with "+" and the country code. For example, US phone number: "+12125551234"

device_id

Yes (for Device Logins)

Unique device identifier. In order to acquire the device id the ĀLO mobile application must be installed on the device.

role

No

"member"

Valid values: "admin", "supervisor", "member", "staff"

is_active

No

true

If this is set to false the user will not be able to login.

send_invitation

No

false

This is only available for phone login user. When set to true an SMS invitation will be sent to the user that you are creating.

Example Phone Login Request Body

{
    "login_type": "PHONE_NUMBER",
    "first_name": "Milton",
    "last_name": "Becker",
    "phone_number": "+12125551234",
    "is_active": true,
    "role": "admin",
    "send_invitation": true
}

Example Device Login Request Body

{
    "login_type": "DEVICE",
    "name": "IPad - VC9090",    
    "device_id": "asdhgh12g3jhdsg222",
    "is_active": true,
    "role": "staff"
}

Success Response

A successful user creation response will have an HTTP status of 201 created. The payload of the response is the same as you will see when requesting information about a specific user.

Error Response

If there was a problem creating the user you will receive a response that contains status and message properties.

Example error response:

{
    "status": 422,
    "message": "Validation failed: First name can't be blank"
}

Get Specified User

Get information about a specific user

GET /users/{user_id}

Path Parameters

Parameter

Description

user_id

Id of the user you are requesting information about

Success Response

A successful user creation response will have an HTTP status of 200

Response Properties

Property

Description

id

Unique user identifier

login_type

The login method for the user. Possible values are: PHONE_NUMBER and DEVICE

phone_number

User's phone number. This property may be blank for DEVICE login users.

device_id

Unique device id for the user. This property may be blank for PHONE_NUMBER login users.

first_name

User's first name. Only available for PHONE_NUMBER users.

last_name

User's last name. Only available for PHONE_NUMBER users.

name

User's device name. Only available for DEVICE users.

email

User's email address/

is_active

When false the user will not have access to the system.

role

User role. Possible values are: admin, supervisor, member and staff

created_at

The date/time the user was created.

updated_at

The date/time the user was last updated.

temp_password

This is only available when creating a new PHONE_NUMBER user. It is then temporary password for the user. The user will need to change it upon first login. NOTE: If you create a new user and do not see a temp password it means there was already a user in ĀLO with the given phone number and this user was simply added to your team.

Example Response Body

{
    "user": {
        "id": "08094317-83fd-4c36-90f0-9d18c6a6b758",
        "login_type": "PHONE_NUMBER",
        "first_name": "Tom",
        "last_name": "Foley",
        "email": tom@example.com,
        "created_at": "2020-07-24T14:48:10.662Z",
        "updated_at": "2021-05-05T12:57:45.813Z",
        "phone_number": "+15554560987",
        "device_id": null,
        "role": "member",
        "is_active": true
    }
}

Update User

Update a specified user.

POST /users/{user_id}

Body Parameters

See Create User Body Parameters.

Success Response

A successful user update response will have an HTTP status of 200. The payload of the response is the same as you will see when requesting information about a specific user.

Though there is a method to delete users we recommend that if you no longer wish to allow a user to access the system you can use the PUT /users/{user-id} method to set the is_active property to false.

Delete User

Delete a specified user

DELETE /users/{user_id}

Path Parameters

Parameter

Description

user_id

Id of the user you are deleting

Success Response

A successful user delete response will have an HTTP status of 200. The payload of the response is the same as you will see when requesting information about a specific user.

In general we discourage deleting user records if they have any kind of history (tasks, chat, etc.). We recommend setting the user's is_active property to false instead.

Last updated

Logo

© Copyright 2024 ALO.ai, Inc. • All Rights Reserved