Company
Represents a business organization in the AirVantage terminology. Almost all entities are associated with a company.
Read only fields are computed in AirVantage and can only be seen on response fragments sent by details or edit requests.
Field | Description | Read Only | Type |
---|---|---|---|
uid | Company's unique identifier. | true | uid |
name | Company's name. Must be unique throughout AirVantage. | false | string |
address | The address of this company. | false | string |
nFactor | Says whether the 2-factor authentication is activated for this company or not. | true | boolean |
ipFiltering | Says whether API requests for resources of this company are filtered or not. | false | boolean |
ipFilters.startIPAddress | This field specifies the beginning of the IP range filter. It is related to endIPAddress field. | false | string |
ipFilters.endIPAddress | This field specifies the ending of the IP range filter. It is related to startIPAddress field. | false | string |
ipFilters.ipAddresses | List of acceptable IP addresses. | false | string list |
deviceIpFiltering | Says whether device communications of this company are filtered or not. | false | boolean |
deviceIpFilters.startIPAddress | This field specifies the beginning of the IP range filter. It is related to endIPAddress field. | false | string |
deviceIpFilters.endIPAddress | This field specifies the ending of the IP range filter. It is related to startIPAddress field. | false | string |
deviceIpFilters.ipAddresses | List of acceptable IP addresses. | false | string list |
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 Company. This fragment can be used for edit request. Please refer to the fields section to know which fields can be modified.
{ "uid": "", "address": "", "name": "", "nFactor": false, "ipFiltering": true, "ipFilters" : { "startIPAddress" : "10.41.51.0", "endIPAddress" : "10.41.51.30", "ipAddresses" : ["10.41.51.255"] }, "deviceIpFiltering":false, "deviceIpFilters" : { "startIPAddress":null, "endIPAddress":null, "ipAddresses":[] } }
API Methods
Get Details
/api/v1/company/{uid}
Returns detailed information about the specified company.
Request
GET https://na.airvantage.net/api/v1/company/1
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... { "uid": "1", "picture": { "normal": "/company/1/picture/normal", "small": "/company/1/picture/small", "icon": "/company/1/picture/icon" }, "address": "Lake Park", "name": "Sierra Wireless", "nFactor" : false }
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
HTTP Method | GET |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | accountNetwork.company.viewDetails |
Edit
/api/v1/company/{uid}
Edits details of a company. Only name, address, ipFiltering, ipFilters, deviceIpFiltering and deviceIpFilters fields can be updated.
Request
PUT https://na.airvantage.net/api/v1/company/a473d07f165048878c2678f362770a59 Content-Type: application/json ... // with the following content { "name" : "New Company Name", "address" : "New address" }
Response
200 OK
... { "name" : "New Company Name", }
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
company.missing.name | Trying to set name field to null. |
company.not.unique.name | The specified name is already set to another company. |
value.too.long | The specified address exceed 255 characters. |
company.missing.ip.address.filtering | Missing IP filters when the company is updated with ip filtering to true. |
company.invalid.ip.address | A specified IP address is not well formated. |
company.invalid.ip.address.range | The specified IP range is invalid. For example, end IP address is missing when start address was given. Or beginning is bigger than the end. |
company.missing.device.ip.address.filtering | Missing IP filters when the company is updated with device ip filtering to true. |
company.invalid.device.ip.address | A specified device IP address is not well formated. |
company.invalid.device.ip.address.range | The specified device IP range is invalid. For example, end IP address is missing when start address was given. Or beginning is bigger than the end. |
HTTP Method | PUT |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | Content-type: application/json |
Permissions | administrator |
Get Administrators
/api/v1/company/{uid}/administrators
Gets the administrators of the given company.
Request
GET https://na.airvantage.net/api/v1/company/a473d07f165048878c2678f362770a59/administrators
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... [ { "uid": "79e40bf47bcd44de93352fc72918fa20", "company" : { "uid": "a473d07f165048878c2678f362770a59" } "email": "admin1@airvantage.net", "name": "Admin 1" }, { "uid": "5cd44bfb5dd14385885e9037866bf823", "company" : { "uid": "a473d07f165048878c2678f362770a59" } "email": "admin2@airvantage.net", "name": "Admin 2" } ]
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
HTTP Method | GET |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | accountNetwork.company.viewAdministrators |
Edit Administrators
/api/v1/company/{uid}/administrators
Sets a new list of administrators of a specific company. In other words, if you want to add a user to the exisiting list of administrator, then you have to send this list extended with the uid of the new user. Notices that it is not possible to send an empty list. At least one administrator must be set.
Request
PUT https://na.airvantage.net/api/v1/company/a473d07f165048878c2678f362770a59/administrators Content-Type: application/json ... { "administrators" : [{"uid" : "79e40bf47bcd44de93352fc72918fa20"}, {"uid" : "5cd44bfb5dd14385885e9037866bf823"}] }
Response
200 OK
HTTP/1.1 200 OK Content-Type: application/json ... [ { "uid": "79e40bf47bcd44de93352fc72918fa20", "company" : { "uid": "a473d07f165048878c2678f362770a59" } "email": "admin1@airvantage.net", "name": "Admin 1" }, { "uid": "5cd44bfb5dd14385885e9037866bf823", "company" : { "uid": "a473d07f165048878c2678f362770a59" } "email": "admin2@airvantage.net", "name": "Admin 2" } ]
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
user.unknown | Raised when a specified user in the administrator list does not exist in the company. |
user.missing | Raised when an empty list were sent. |
admin.without.profile | A user without profile cannot be removed from the administrator list. |
HTTP Method | PUT |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | administrator |
Get Picture
/api/v1/company/{uid}/picture/{name}
Gets the company image in a specific size: original size, thumbnail size, or icon size.
Request
GET https://na.airvantage.net/api/v1/company/1/picture/small ...
Response
200 OK
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
company.file.not.found | The requested image does not exist. |
HTTP Method | GET |
Requires Authentication | Yes |
Rate Limited | Yes |
Headers | None |
Permissions | accountNetwork.company.viewDetails |
Upload picture
/api/v1/company/{uid}/picture
Uploads an image. The service creates 3 images in the file store 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/companies/1/picture Content-Type: image/jpeg // with an attached jpeg file ...
Response
200 OK
HTTP/1.1 200 OK
Name | Description |
---|---|
company.unknown | The specified uid does not match with any existing company. |
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 |