Individual user, acts in the context of a company depending on the rights he has. A user can have access granted on several companies.
Read only fields are computed by AirVantage and can only be seen on response fragments sent by
find, create, or edit requests.
Field |
Description |
Read Only |
Type |
uid |
User's unique identifier. |
true |
uid |
email |
User's email. Only an administrator or the user itself can change this field. It has to be unique. |
false |
string |
name |
User's name. |
false |
string |
password |
User's password. This field will not be returned in any response fragment.
It must respect the following rules |
false |
string |
phoneNumber |
User's phone number. A phone number must be provided when the company requires 2-factor authentication.
A phone number must be set in international format and must respect the regexp ^(\+[1-9])[0-9]{0,18} |
false|true |
string |
profile |
A simple view of the profile assigned to this user. It shows its uid and name. Can be null when this user is an administrator. |
true |
|
company |
A simple view of the company this user belongs to. It shows its uid and name. |
true |
|
picture |
References to a picture in three different sizes:
- Normal: keeps original image.
- Small : resized image to 32x32 pixels keeping the length/width ratio.
- icon : resized image to 16x16 pixels keeping the original length/width ratio.
|
true |
string |
This is a complete representation of a User. This fragment can be used for create or edit requests.
Please refer to the fields section to know which fields can be modified.
{
"uid": "any_uid_string",
"email": "any_email@domain.net",
"password" : "any_password",
"name": "any_string",
"profile": {
"uid": "any_uid_string",
"name": "any_string"
},
"company": {
"uid": "any_uid_string",
"name": "any_string"
},
"picture": {
"icon": "/users/any_uid_string/picture/icon",
"normal": "/users/any_uid_string/picture/normal",
"small": "/users/any_uid_string/picture/small"
}
}
/api/v1/users/rights
Returns a list of rights assigned to the authenticated user. User rights are calculated based on their context.
Request
GET https://na.airvantage.net/api/v1/users/rights
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json[][]
...
["entities.applications.view", "accountNetwork.users.createEdit"]
Name |
Description |
Use |
Default |
Type |
Operand |
company |
The user's company. |
optional |
context company |
uid string |
= |
Name |
Description |
partner.unknown |
The user's company does not have any relationship with the specified company. |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
None |
/api/v1/users
Returns a paginated list of users with their complete details.
It is possible to restrain the result list using criteria parameters.
The fields parameter has to be defined in order to specify the attributes of the user which will be returned.
If fields parameter is missing, only the following attributes of the user are returned: uid, name, email.
More information about paging, filtering, and sorting here
Request
GET https://na.airvantage.net/api/v1/users?fields=uid,name,email,profile
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
{
"items": [ {
"uid": "1cb5e5fc9bc14fa584bfe417a91e7881",
"name": "MyUser",
"email": "myuser@airvantage.net",
"profile": {
"uid": "5a3e78ca0ea64d6a9bdaef5966e8b374",
"name": "MyProfile"
}
}],
"count": 1,
"size": 1,
"offset": 0
}
Name |
Description |
Use |
Default |
Type |
Operand |
uid |
Find user whose uid match with the specified id. |
optional |
null |
uid string |
= |
email |
Find users of which the email contains the specified string |
optional |
null |
string |
like |
company |
The user's company. |
optional |
context company |
uid string |
= |
name |
Find users of which the name contains the specified string |
optional |
null |
string |
like |
profile |
Find users linked to a profile |
optional |
null |
uid string |
= |
freetext |
Find users of which email, name, or profile name contains the specified string |
optional |
null |
string |
like |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
accountNetwork.users.view |
Order by |
name, email, profile |
Fields |
uid, name, email, profile, company, picture |
/api/v1/users/{uid}
Returns detailed information about the specified user.
Request
GET https://na.airvantage.net/api/v1/users/1
...
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"company": {
"uid": "1",
"name": "Sierra Wireless"
},
"uid": "1",
"email": "administrator@airvantage.net",
"picture": {
"normal": "/users/1/picture/normal",
"small": "/users/1/picture/small",
"icon": "/users/1/picture/icon"
},
"name": "The Administrator",
"profile": null
}
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
accountNetwork.users.view |
/api/v1/users/current
Returns detailed information about the current user.
Request
GET https://na.airvantage.net/api/v1/users/current
...
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"company": {
"uid": "1",
"name": "Sierra Wireless"
},
"uid": "1",
"email": "administrator@airvantage.net",
"picture": {
"normal": "/users/1/picture/normal",
"small": "/users/1/picture/small",
"icon": "/users/1/picture/icon"
},
"name": "The Administrator",
"profile": null
}
Name |
Description |
user.unknown |
No current user currentlty logged in. |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
accountNetwork.users.view |
/api/v1/users
Creates a new user. Email, name, password, and profile are required fields. phoneNumber is optional.
Request
POST https://na.airvantage.net/api/v1/users
Content-Type: application/json
...
// With content:
{
"name":"Rodrigue",
"email":"operator@airvantage.net",
"password":"FCMM13r8m}pYu'E",
"profile": {
"uid":"ee81d84aec5b4d4397ead51b823b76a7"
}
}
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"uid": "a86e9a3ff1df4a13b39c24f48f1967ed",
"email": "operator@airvantage.net",
"name": "Rodrigue",
"phoneNumber" : null,
"profile": {
"uid": "ee81d84aec5b4d4397ead51b823b76a7",
"name": "operator"
},
"company": {
"uid": "6500ee29f8ed4e3991dff484b3ce3e73",
"name": "Current Company Name"
},
"picture" : null
}
Name |
Description |
Use |
Default |
Type |
company |
The company the new user will belong to. |
optional |
context company |
uid string |
Name |
Description |
user.not.unique.email |
Someone has already the specified email. |
user.missing.email |
An email must be provided. |
user.missing.name |
A name must be provided. |
user.missing.password |
A password must be provided. |
user.bad.format.email |
Provided string does not match the right email format. |
user.bad.format.phone.number |
Provided string does not match the right phoneNumber format. See User overview fields for more information. |
profile.missing |
A profile must be provided. |
profile.unknown |
Provided profile does not exist. |
password.invalid |
Provided password does not match the password strength rules. |
value.too.long |
Provided name or email strings is bigger than 50 characters. |
HTTP Method |
POST |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
administrator |
/api/v1/users/{uid}
Edits user details. User details can be edited by an administrator or by the user himself.
However if the user is not an administrator, the profile cannot be changed.
Request
PUT https://na.airvantage.net/api/v1/users/a86e9a3ff1df4a13b39c24f48f1967ed
Content-Type: application/json
...
// With content:
{
"name" : "Rodrigue Dupont",
"email" : "rodrigue@dupont.com",
"password" : "xxxxxxx",
"phoneNumber" : "+349854797415",
"profile": {
"uid":"63ee28685c8c4ad0a7e408f88abaffc4"
}
}
Response
200 OK
...
{
"uid": "a86e9a3ff1df4a13b39c24f48f1967ed",
"email": "rodrigue@dupont.com",
"name": "Rodrigue Dupont",
"phoneNumber" : "+349854797415",
"profile": {
"uid": "63ee28685c8c4ad0a7e408f88abaffc4",
"name": "user"
},
"company": {
"uid": "6500ee29f8ed4e3991dff484b3ce3e73",
"name": "Current Company Name"
},
"picture" : null
}
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
user.not.authorize |
The user is not allowed to change its profile |
user.not.unique.email |
Someone has already the specified email. |
user.missing.email |
Provided email cannot be and empty string. |
user.missing.name |
Provided name cannot be and empty string. |
user.missing.password |
Provided password cannot be and empty string. |
user.bad.format.email |
Provided string does not match the right email format. |
user.bad.format.phone.number |
Provided string does not match the right phoneNumber format. See User overview fields for more information. |
profile.unknown |
Provided profile does not exist. |
password.invalid |
Provided password does not match the password strength rules. |
value.too.long |
Provided name or email are bigger than 50 characters. |
HTTP Method |
PUT |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
administrator/none |
/api/v1/users/{uid}/picture
Uploads an image. The service creates 3 images in the fileStore for the uploaded one.
Uploaded images cannot be bigger than 750KB and dimensions have to be equals or less than 1024 px per side.
Request
POST https://na.airvantage.net/api/v1/users/1/picture
Content-Type: image/jpeg
// with an attached jpeg file
...
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
invalid.format |
Expected formats are JPG or PNG. |
image.invalid.dimension |
Images cannot have more than 1024 px per side. |
file.too.large |
Images cannot be more than 750KB. |
HTTP Method |
POST |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
Content-type: image/jpeg||png) |
Permissions |
administrator/none |
/api/v1/users/{uid}/picture/{name}
Gets one of the user pictures.
Request
GET https://na.airvantage.net/api/v1/users/1/picture/small
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
user.file.not.found |
The requested image does not exist. |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
accountNetwork.user.view |
/api/v1/users/{uid}
Deletes a user. If the user is the unique administrator of a company, it can't be deleted.
Request
DELETE https://na.airvantage.net/api/v1/users/a86e9a3ff1df4a13b39c24f48f1967ed
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
user.unique.administrator |
At least one administrator must be set. |
HTTP Method |
DELETE |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
administrator/none |
/api/v1/users/{uid}/clients
Gets the list of all API clients authorized by this user.
Request
GET https://na.airvantage.net/api/v1/users/1/clients
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
...
[
{
"name": "Test",
"description": "Api Client description",
"uid": "ed5d212963d1487995758d7f3c2e4c5d",
"pictureUrl": null
}
]
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
HTTP Method |
GET |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
accountNetwork.users.view |
/api/v1/users/{uid}/clients
Revokes an API client from the list of authorized clients authorized by this user. This method returns the remaining API clients.
Request
DELETE https://na.airvantage.net/api/v1/users/a86e9a3ff1df4a13b39c24f48f1967ed/clients?apiClient=ed5d212963d1487995758d7f3c2e4c5d
Response
200 OK
HTTP/1.1 200 OK
Content-Type: application/json
...
[]
Name |
Description |
Use |
Default |
Type |
Operand |
apiClients |
Coma separated list of API client Ids. |
required |
null |
uid list |
= |
Name |
Description |
user.unknown |
The specified uid does not match with any user. |
HTTP Method |
DELETE |
Requires Authentication |
Yes |
Rate Limited |
Yes |
Headers |
None |
Permissions |
administrator/none |