Skip to content

User Information

Operations

Get User Information

Request

Retrieve profile information about the currently logged in user. The return result in the example has been condensed to include only the data that an application may be interested in.

The data returned in the data key is outlined below:

KeyDescription
preferences.dialerAccessFromAn array of countries that the logged in user has access to use for the from when making a call.
preferences.dialerAccessToAn array of countries that the logged in user has access to use for the to when making a call.
mobileBnumsAn array of phone numbers that the logged in user has access to send SMS messages from.

Dialer Access

The dialerAccessFrom and dialerAccessTo keys are each provided as an array of objects. Each object represents a country that the user has access to in the following format:

KeyDescription
nameThe name of the country.
prefixThe dial prefix for the country.
allowThe type of phone numbers that the user has access to for this country (examples: all, landline, mobile).

Note: If the user has access to all countries, then instead of an array, the value of the dialerAccessFrom or dialerAccessTo will be a string with a single asterisk (*).

If an API call is made to make a call to a country that the user doesn't have access to, it will simply fail and return an appropriate error message. However, downloading and caching these country lists allows the application to validate the call without making an API call. Additionally, this allows the application to provide a configuration form for the user to select the phone number to use for their from for all calls. The application can use the dialerAccessFrom list to display a list of countries, and the user can simply select a country and type their phone number in local format, which the application can then convert into AVANSER format appropriately.

Note that these settings may change, so the values should only be cached for a single session.

Mobile BNUMS

The mobileBnums key is an object containing a list of phone numbers that the logged in user has access to send SMS messages from. The object key is the name used to represent the phone number in the AVANSER portal, and the value is the phone number itself. As this list is limited, it is often useful to display a list of phone numbers for the user to select from, rather than having them enter a phone number manually.

Note that a user may have access to view messages for BNUMs that they can't send messages from. Also, this list may change, so the values should only be cached for a single session.

Security
accessToken
curl -i -X GET \
  'https://p3.avanser.com/app/profile?token=YOUR_API_KEY_HERE'

Responses

Profile information.

Bodyapplication/json
timestampintegerrequired

The time that the API response left the server, represented as the number of seconds since the UNIX epoch.

Example:1508903167
exectionnumber

The number of seconds that it took to process the API request.

Example:0.00041531896591187
errorbooleanrequired

Boolean indicating whether there was an error returned by the API request.

Example:false
dataobjectrequired

The data returned by the API. The format varies depending on the API function that was called.

Response
{ "timestamp": 1508975327, "exection": 0.000060782909393311, "error": false, "data": { "preferences": { … }, "mobileBnums": { … } } }