VXG provides a powerful API for integration with web and mobile applicationsother services and front-ends. The API functions are divided into several sections. An interactive Each section has an API reference (Swagger) can be found below:
V2 Admin API.
Authorization - in Swagger format. Each function can be called and tested online.
...
Authorization
The API functions are divided into 3 categories with different levels of security.
“Acc” authorization
The least secure API uses a "camera access token" for authorization and it's designed for use with front-ends like web and mobile apps. The “camera access token” is a unique camera identifier that can be changed at any time.
All function calls require an authorization header:
Code Block |
---|
'Authorization: Acc %channel_access_token%' |
Example of an authorization header:
Code Block |
---|
curl -X GET \
"https://web.vxgdemo.vxgdemo.cloud-vms.com/api/v4/live/watch/" \
-H "accept: application/json" \
-H "Authorization: Acc eyJjYW1pZCI6IDI0ODUyNywgImNtbmdyaWQiOiAyNDg5NjQsICJhY2Nlc3MiOiAiYWxsIiwgInRva2VuIjogInNoYXJlLmV5SnphU0k2SURJek5UWXpPWDAuNjFhOTY0YzN0YmMxZmFiMDAueEJXWGRrc0FVUnY2d3M1TU9aWC1BUUloLUtNIiwgImFwaSI6ICJ3ZWIuc2t5dnIudmlkZW9leHBlcnRzZ3JvdXAuY29tIiwgImNhbSI6ICJjYW0uc2t5dnIudmlkZW9leHBlcnRzZ3JvdXAuY29tIn0=" |
Similar to a “camera access token”, Cloud VMS also operates with “group access tokens” that represent a group of cameras. The API for “group access tokens” uses “SI” instead of “Acc” in the authorization header.
“LKey” authorization
The next level is Admin API which uses a "license key" for authorization and it's designed to be used from a back-end. On this level, the API can add new cameras and control cloud resources. It can also retrieve “camera access tokens” and generate new ones. There is one "license key" per account/user (which can be a user, organization, or customer).
The “license key” should be injected into the Authorization header of every request:
Code Block |
---|
Authorization: LKey %license_key% |
For example, if the license key is "v3.X9tKpuXq0btatj":
Code Block |
---|
curl -X GET \
"https://web.vxgdemo.vxgdemo.cloud-vms.com/api/v3/channels/" \
-H "accept: application/json" \
-H "Authorization: LKey v3.X9tKpuXq0btatj" |
Key & certificate authentication
The highest level of security is used by super admin API and it requires a key & certificate for authentication. It's designed for cloud-to-cloud communication. On this level, the API can create accounts/users, retrieve existing “license keys”, or generate new ones.
For example:
Code Block |
---|
curl -X POST \
--key ./company.key\
--cert ./company.crt\
-k\
https://ip:9000/api/v2/admin/users/\
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"suid\": \"user_id\", \"usrc\": \"Company_name\", \"license_key\": {\"value\": \"LICENSEKEY\"}, \" limits\": {\"hosted_cameras\": 100} }" |
V2 API
Authorization - license key (LKey)
https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.com/docs/v2.html
V3
...
API
...
Authorization - license key (LKey)
https://web.skyvr.videoexpertsgroupvxgdemo.vxgdemo.cloud-vms.com/docs/v3.html
V4
...
API
...
Authorization - access token (Acc)
https://web.skyvr.videoexpertsgroupvxgdemo.vxgdemo.cloud-vms.com/docs/v4.html
V5
...
API
...
Authorization - group access token (SI)
https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.com/docs/v5.html
V2 Super-admin API
...
Authorization - SSL key/certificate pair.
https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.com/docs/v2_admin.html
Admin API authorization
To authorize your requests to Admin API you need to use the license key that you can find in the integration section of the web UI.
The API Key should be injected into the Authorization header of every request to Admin API like this:
Code Block |
---|
Authorization: LKey %license_key% |
For example, if the API key is "X9tKpuXq0btatj":
Code Block |
---|
Authorization: LKey X9tKpuXq0btatj |
Non-admin API authorization
All function calls require an authorization header:
Code Block |
---|
'Authorization: Acc %channel_access_token%' |
The %channel_access_token% can be retrieved in two ways:
Using Admin API while creating a channel or updating of a channel access token
Using Cloud/Server Admin UI page
Example of an authorization header:
...
...