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 in the Docs & API section on VXG Dashboard in corresponding API sections.
Admin API
Add/edit/delete cameras
Manage storage and bandwidth limits
Retrieve usage statistics
Store/retrieve meta information
Channel API
Get live video URLs
Get the recorded video
Get stored images and clips
Store new images and clips
Get recorded video timeline
Communication channel (Websocket) for cloud cameras.
Camera Settings API
Video settings: bitrate, framerate, resolution, etc.
Audio settings
PTZ controls
Motion and audio detectors
System settings
Events and Notifications API
Put/Get metadata and events
Send notifications
Artificial Intelligence (AI) API
Generate images from recorded video
Generate images from live video
Create clips
Get the live video
Get the recorded video
Admin API authorization
To authorize your requests to Admin API you need to use your license key that you can find on VXG Dashboard.
The API Key should be injected to Authorization header of every request to Admin API like thisin 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 API 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 |
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 during creating a channel or updating of a channel access token
Using Cloud/Server Admin UI page
Example of an authorization header:
Code Block |
---|
'Authorization: Acc eyJhY2Nlc3MiOiAid2F0Y2giLCAidG9rZW4iOiAic2hhcmUuZXlKemFTSTZJRE14T0RoOS41YWEyMjA2N3QxMmNmZjc4MC5GVHpEeUZMYkVLQVNzM2ZJRFZaSDdFMEhhdGMiLCAiY2FtaWQiOiAxMzI0NDUsICJjbW5ncmlkIjogMTMyODUwLCAiYXBpIjogIndlYi5za3l2ci52aWRlb2V4cGVydHNncm91cC5jb20ifQ=='" |
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.vxgdemo.cloud-vms.com/docs/v2.html
V3 API
Authorization - license key (LKey)
https://web.vxgdemo.vxgdemo.cloud-vms.com/docs/v3.html
V4 API
Authorization - access token (Acc)
https://web.vxgdemo.vxgdemo.cloud-vms.com/docs/v4.html
V5 API
Authorization - group access token (SI)
https://web.vxgdemo.vxgdemo.cloud-vms.com/docs/v5.html
V2 Super-admin API
Authorization - SSL key/certificate pair
https://web.vxgdemo.vxgdemo.cloud-vms.com/docs/v2_admin.html
...