Integrating VSAAS.IO billing service and cloud.vsaas.io cloud video surveillance service¶
In this article, you will learn how a provider can implement VSAAS.IO billing service and cloud video surveillance service cloud.vsaas.io to sell camera subscriptions and do accounting for subscribers and organizations.
As a provider, do the following:
- Sign up to VSAAS.IO account
-
See typical billing and cloud Watcher usage scenarios
- Create a billing plan
- Create an organization with a list of available billing plans
- Create a user with read-only permissions
- Create a user to edit the camera
- Remove the user with the permission to edit the camera
- Add billing plans to an existing organization
- Change the default billing plan
- Disable the camera
Glossary¶
- Provider is a customer of Flussonic that rents our billing and cloud-based video surveillance service.
- Subscriber is a Provider's customer, the user of the cloud.vsaas.io service.
- Preset is a set of DVR and analytics parameters that you can use as a template when creating and configuring cameras. Presets correspond to the billing plans. You should create and configure presets before adding cameras.
- VSAAS.IO (my.vsaas.io) is a billing service that manages billing plans of Provider's services to subscribers and payments for using cloud.vsaas.io. Users in VSAAS.IO are Administrators and accountants who collect information about who owes whom and how much money.
- cloud.vsaas.io is Flussonic Watcher's cloud-based video surveillance service. Provider's customers (organizations) use cloud.vsaas.io. It defines all technical capabilities of the video surveillance service: management of subscribers' and installers' accounts, cameras and their settings, features of billing plans.
Features of VSAAS.IO and cloud.vsaas.io¶
VSAAS.IO and cloud.vsaas.io are different entities. VSAAS.IO communicates with cloud.vsaas.io, but not vice versa. This means that you won't get billing data from cloud.vsaas.io. VSAAS.IO handles billing, and cloud.vsaas.io handles cameras.
VSAAS.IO and cloud.vsaas.io have their own API. Some methods are available in VSAAS.IO (my.vsaas.io) and aren't available in cloud.vsaas.io and vice versa. For example, in VSAAS.IO (my.vsaas.io) you can create or modify an organization, while in cloud.vsaas.io you can only get organization data.
Billing is calculated once a day around midnight. Do not configure the integration to regularly poll the billing system. New cameras added today will be visible tomorrow.
More details about VSAAS.IO billing here
Signing up a provider to VSAAS.IO account¶
An account on VSAAS.IO is needed to set up tariffs and issue invoices to subscribers. We create accounts upon request, email us specifying the name of your organization.
We will provide you with a domain like YOURNAME.vsaas.io
, or discuss the possibility of linking your own domain.
In the future, you will be able to log in directly to the personal account using the email from which you sent the request.
Typical billing and cloud Watcher usage scenarios¶
This section provides scenarios for using VSAAS.IO billing and cloud.vsaas.io cloud video surveillance service.
Warning
my.vsaas.io and cloud.vsaas.io use the API v1 and v2 accordingly. We will migrate to API v3 to achieve a common format among all products of the Flussonic ecosystem. You can learn about these and other updates from the blog.
Create a billing plan¶
- Log in to your Administrator account at my.vsass.io.
- Create a billing plan by going to the BILLING PLANS tab and clicking CREATE NEW BILLING PLAN. Fill in the form and click SAVE to save the billing plan. The added billing plan along with its start date will be displayed in the list of billing plans under the BILLING PLANS tab.
- Look up the billing plan ID by calling the GET https://my.vsaas.io/api/v1/tariff_plans method. The billing plan has two IDs: one is for my.vsaas.io—
id
and the other one is for cloud.vsaas.io—external_id
. Use the method for mapping to CRM.
Create an organization with a list of available billing plans¶
- Create an organization by calling the my.vsaas.io API method POST https://my.vsaas.io/api/v1/organizations and specify the domain owner (
owner
) with a list of required billing plans. This method creates an organization both in billing (my.vsaas.io) and cloud Watcher (cloud.vsaas.io) assigning two different organization IDs. One is for my.vsaas.io—id
and the other one is for cloud.vsaas.io—external_id
.
Create a user with read-only permissions¶
Using only the cloud Watcher (cloud.vsaas.io).
- Create a user by calling the cloud.vsaas.io API method POST /vsaas/api/v2/users.
- Connect the user to the desired organization by calling the cloud.vsaas.io API method POST /vsaas/api/v2/organizations/ORGANIZATION-ID/users. You can find out the organization ID by using the get organization list method GET /vsaas/api/v2/organizations.
- Get the camera folder ID using the cloud.vsaas.io API method to get a list of organization folders GET vsaas/api/v2/organizations/ORGANIZATION-ID/folders.
- Grant permissions in the folders of the desired organization to the user by calling the cloud.vsaas.io API method POST /vsaas/api/v2/organizations/ORGANIZATION-ID/folders/FOLDER-ID/users.
- Remove the user from the default organization by calling the cloud.vsaas.io API method DELETE /vsaas/api/v2/organizations/ORGANIZATION-ID/users/USER-ID. Now the subscriber is assigned to the correct organization.
Create a user to edit the camera¶
The camera installer is the example of a user to edit the camera.
Accessing cloud Watcher (cloud.vsaas.io) only.
Note
The difference between creating a user for camera installation and creating a user for a subscriber with read-only permissions is that when the user connects to an organization, the user is given special permissions to add cameras (see step 2).
- Create a user by calling the cloud.vsaas.io API method POST /vsaas/api/v2/users.
- Connect a user with special permission to add cameras:
“can_edit_organization_cameras”: true
to the organization. To do this, call the cloud.vsaas.io API method POST /vsaas/api/v2/organizations/ORGANIZATION-ID/users. You can find out the organization ID by using the get organization list method GET /vsaas/api/v2/organizations. - Get the camera folder ID using the cloud.vsaas.io API method to get a list of organization folders GET vsaas/api/v2/organizations/ORGANIZATION-ID/folders.
- Grant permissions in the folders of the desired organization to the user by calling the cloud.vsaas.io API method POST /vsaas/api/v2/organizations/ORGANIZATION-ID/folders/FOLDER-ID/users.
- Remove the user from the default organization by calling the cloud.vsaas.io API method DELETE /vsaas/api/v2/organizations/ORGANIZATION-ID/users/USER-ID. Now the subscriber is assigned to the correct organization.
Remove the user with the permission to edit the camera¶
Remove a user with special permission to edit cameras (installer) using the cloud.vsaas.io API method DELETE '/vsaas/api/v2/users/USER-ID.
Add billing plans to an existing organization¶
Update the organization's billing plans using the my.vsaas.io API method PUT /organizations/ORGANIZATION-ID.
Change the default billing plan¶
- Log in to your Administrator account at my.vsass.io.
- Create a billing plan by going to the BILLING PLANS tab and clicking CREATE NEW BILLING PLAN. Fill in the form and check Apply to Organisations by default.
- Save the billing plan by clicking SAVE. The new billing plan along with its start date will be displayed in the list of billing plans under the BILLING PLANS tab.
The previous default billing plan moves to the regular billing plans because there can only be one default billing plan.
Disable the camera¶
There are two ways to do this:
-
Using the VSAAS.IO web interface.
- Log in to the Administrator account in cloud.vsaas.io.
- Move to the My cameras tab.
- Click the settings of the desired camera (gear icon), find the SETTING OPTIONS, and uncheck the Enabled checkbox.
- Save the settings by clicking Save or pressing Ctrl+S.
-
Using the cloud.vsaas.io API.
Use the PUT vsaas/api/v2/cameras/OBJECT-ID method.
VSAAS.IO API¶
API v1 for billing VSAAS.IO.
Authorization¶
Only the domain owner and Administrator can make requests to the VSAAS.IO API.
All requests to VSAAS.IO API require authorization with:
- username (
X-USER: ADMIN-EMAIL-ADDRESS
), - password (
X-PASSWORD: ADMIN-PASSWORD
), - domain ID (
X-DOMAIN-ID: 000
). Ask your manager for the domain ID.
Billing plans¶
Managing billing plans in my.vsaas.io.
Get a list of all available billing plans¶
curl -H "Content-Type: application/json" \
-H "X-USER: ADMIN-EMAIL-ADDRESS" \
-H "X-PASSWORD: ADMIN-PASSWORD" \
-H "X-DOMAIN-ID: 000" \
-X GET 'https://my.vsaas.io/api/v1/tariff_plans'
Response example:
{
"tariff_plans": [
{
"id": 549,
"name": "Test plan",
"date_from": "27/04/2024",
"full_price": "100.0 USD",
"status": "Active",
"external_id": 392
},
{
"id": 548,
"name": "Default",
"date_from": "27/04/2024",
"full_price": "0.0 USD",
"status": "Active",
"external_id": 391
}
]
}
Organizations¶
Managing organizations in my.vsaas.io.
Get a list of all available organizations or data on a specific organization¶
curl -H "Content-Type: application/json" \
-H "X-USER: ADMIN-EMAIL-ADDRESS" \
-H "X-PASSWORD: ADMIN-PASSWORD" \
-H "X-DOMAIN-ID: 000" \
-X GET 'https://my.vsaas.io/api/v1/organizations'
Response example:
{
"organizations": [
{
"id": 736,
"title": "My organization",
"domain": {
"id": 247,
"title": "YOUR-DOMAIN-NAME"
},
"owner": {
"id": 410,
"email": "demo@example.org"
},
"discount": "0%",
"trial_expired_at": "",
"external_id": 753,
"tariff_plans": [
{
"id": 548,
"name": "Default",
"date_from": "27/04/2024",
"full_price": "0.0 USD",
"status": "Active",
"external_id": 391
}
]
}
]
}
Add the organization with billing plans or without them¶
This call creates an organization in both VSAAS.IO and cloud.vsaas.io with a default billing plan Default
.
curl -H "Content-Type: application/json" \
-H "X-USER: ADMIN-EMAIL-ADDRESS" \
-H "X-PASSWORD: ADMIN-PASSWORD" \
-H "X-DOMAIN-ID: 000" \
-X POST 'https://my.vsaas.io/api/v1/organizations'
-d '{"organization": {"title": "Demo org", "owner": "demo@example.org", "tariff_plans": [549]}}'
where:
- (required)
title
is the name of the organization. - (required)
owner
is the e-mail address of the owner of the organization. It can be either existing or arbitrary. If you specify an arbitrary address, a new user will be created and an e-mail will be sent to the specified address with a request to confirm it and come up with the password. tariff_plans
is the list of billing plan IDs. You can find out the billing plan ID by getting a list of all available billing plans.
Response example:
{
"organization": {
"id": 797,
"title": "Demo org",
"domain": {
"id": 247,
"title": "YOUR-DOMAIN-NAME"
},
"owner": {
"id": 410,
"email": "demo@example.org"
},
"discount": "0%",
"trial_expired_at": "",
"external_id": 774,
"tariff_plans": [
{
"id": 548,
"name": "Default",
"date_from": "27/04/2024",
"full_price": "0.0 USD",
"status": "Active",
"external_id": 391
},
{
"id": 549,
"name": "Test plan",
"date_from": "27/04/2024",
"full_price": "100.0 USD",
"status": "Active",
"external_id": 392
}
]
}
}
Modify billing plans of the existing organization¶
curl -H "Content-Type: application/json" \
-H "X-USER: ADMIN-EMAIL-ADDRESS" \
-H "X-PASSWORD: ADMIN-PASSWORD" \
-H "X-DOMAIN-ID: 000" \
-X PUT 'https://my.vsaas.io/api/v1/organizations/ORGANIZATION-ID'
-d '{"organization": {"tariff_plans": [550]}}'
- (required)
ORGANIZATION-ID
is the organization ID. tariff_plans
is the list of billing plan IDs. You can find out the billing plan ID by getting a list of all available billing plans. If you pass an empty list, the organization will have no billing plans.
Response example:
{
"organization": {
"id": 797,
"title": "Unedited org",
"domain": {
"id": 247,
"title": "bikbaeva"
},
"owner": {
"id": 410,
"email": "demo@example.org"
},
"discount": "0%",
"trial_expired_at": "",
"external_id": 774,
"tariff_plans": [
{
"id": 548,
"name": "Default",
"date_from": "27/04/2024",
"full_price": "0.0 USD",
"status": "Active",
"external_id": 391
},
{
"id": 550,
"name": "My demo plan",
"date_from": "02/05/2024",
"full_price": "1500.0 USD",
"status": "Active",
"external_id": 393
}
]
}
}
Remove the existing organization¶
curl -H "Content-Type: application/json" \
-H "X-USER: ADMIN-EMAIL-ADDRESS" \
-H "X-PASSWORD: ADMIN-PASSWORD" \
-H "X-DOMAIN-ID: 000" \
-X DELETE 'https://my.vsaas.io/api/v1/organizations/ORGANIZATION-ID'
where ORGANIZATION-ID
is the organization ID.
Response: 204 No content
cloud.vsaas.io API¶
API v2 fo cloud video surveillance service cloud.vsaas.io.
In cloud.vsaas.io you can set the following permissions for users:
- edit organization cameras камеры организации (
"can_edit_organization_cameras"
) - edit organization users (
"can_edit_organization_users"
) - edit organizations (
"can_edit_organizations"
) - view cameras
- view statistics on cameras (
"can_view_organization_stats"
)
Authorization¶
Only the domain owner and Administrator can make requests to the VSAAS.IO API.
All requests to the cloud.vsaas.io API require authorization by the Administrator API key (x-vsaas-api-key: VSAAS-ADMIN-API-KEY
). You can copy the Administrator API key from the cloud.vsaas.io web interface: Admin > Settings > General Settings > API Key.
Cameras¶
Managing cameras in cloud.vsaas.io.
Get a list of all cameras and their data in the domain¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras'
where YOUR-DOMAIN-NAME
is the domain name.
Response example:
[
{
"name": "camera02-5ca25a2330",
"onvif_ptz": false,
"organization_id": 752,
"stream_url": "fake://fake",
"substream_url": "",
"title": "Camera02",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
"comment": "",
"coordinates": "",
"enabled": false,
"folder_id": 1155,
"has_actions": false,
"last_change": {
"user": "demo@example.org",
"domain_id": 143,
"object_id": "camera02-5ca25a2330",
"created_at": 1715105180,
"event_data": {
"changed_data": {
"_enabled": [
true,
false
]
}
},
"action_type": "change",
"object_type": "Camera",
"request_data": {
"ip": "188.170.86.201,188.170.86.201",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
},
"motion_detector_enabled": false,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "camera02-5ca25a2330",
"server": null,
"alive": false,
"lifetime": null,
"bitrate": null,
"source_error": "no_stream_status",
"http_port": null,
"https_port": null
}
},
...
]
Note
The response returns the ID of the preset, but it does not return the ID of the billing plan defined in the billing system. This means that you need to compare the preset ID with the billing plan ID on your side.
Get the data on the camera¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras/OBJECT-ID'
where:
YOUR-DOMAIN-NAME
is the domain name.OBJECT-ID
is the camera ID. Find out the camera ID using GET /vsaas/api/v2/cameras or GET /vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID.
Response will be same as on cameras list, but contains only a one element.
Get a list of all cameras and their data in the organization¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.
Response example:
[
{
"comment": "",
"coordinates": "",
"enabled": false,
"folder_id": 1155,
"groups": [],
"has_actions": false,
"last_change": {
"user": "a.bikbaeva@erlyvideo.org",
"domain_id": 143,
"object_id": "camera02-5ca25a2330",
"created_at": 1715105180,
"event_data": {
"changed_data": {
"_enabled": [
true,
false
],
"extra_config": [
null,
{
"video_only": false,
"transcode_audio": false
}
]
}
},
"action_type": "change",
"object_repr": "<CloudStream camera02-5ca25a2330>",
"object_type": "Camera",
"request_data": {
"ip": "188.170.86.201,188.170.86.201",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
},
"motion_detector_enabled": false,
"name": "camera02-5ca25a2330",
"onvif_ptz": false,
"organization_id": 752,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"playback_config": {
"token": "3.sJXDwZNHAAAAAAAAAAAAAAAAAAAAjylfLugHFgvX5iaFryiQBGFeBkLA"
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "camera02-5ca25a2330",
"server": null,
"alive": false,
"lifetime": null,
"bitrate": null,
"source_error": "no_stream_status",
"http_port": null,
"https_port": null
},
"stream_url": "fake://fake",
"provision_required": false,
"substream_url": "",
"thumbnails": false,
"title": "Camera02",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
},
{
"comment": "",
"coordinates": "",
"enabled": true,
"folder_id": 1155,
"groups": [],
"has_actions": false,
"last_change": {
"user": "a.bikbaeva@erlyvideo.org",
"domain_id": 143,
"object_id": "camera05-6f057b160a",
"created_at": 1714737887,
"event_data": {
"changed_data": {
"extra_config": [
null,
{
"video_only": false,
"transcode_audio": false
}
]
}
},
"action_type": "change",
"object_repr": "<CloudStream camera05-6f057b160a>",
"object_type": "Camera",
"request_data": {
"ip": "188.242.170.19,188.242.170.19",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
},
"motion_detector_enabled": false,
"name": "camera05-6f057b160a",
"onvif_ptz": false,
"organization_id": 752,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"playback_config": {
"token": "3.sJXDwZNHAAAAAAAAAAAAAAAAAAAAj9odoI-86sxLhc4uyZT9PcR5TedY"
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "camera05-6f057b160a",
"server": "eu-004.vscdn.io",
"alive": true,
"lifetime": 385264839,
"bitrate": 196,
"source_error": null,
"http_port": null,
"https_port": null
},
"stream_url": "fake://fake",
"streamer_hostname": "eu-004.vscdn.io",
"provision_required": false,
"substream_url": "",
"thumbnails": false,
"title": "Camera05",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
}
]
Change the billing plan for the camera¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X PUT 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras/OBJECT-ID'
--data '{"preset_id": 526}'
where:
YOUR-DOMAIN-NAME
is the domain name.OBJECT-ID
is the camera ID. Find out the camera ID using GET /vsaas/api/v2/cameras or GET /vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID.preset_id
is the ID of the preset you want to set for the camera. Find out the preset ID using GET /vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID.
Response example:
{
"comment": "",
"coordinates": "",
"enabled": true,
"folder_id": 1179,
"groups": [],
"has_actions": false,
"last_change": {
"user": "domain_143_via_apikey",
"domain_id": 143,
"object_id": "cam-10-9bdbc979dd",
"created_at": 1715128188,
"event_data": {
"changed_data": {
"preset": [
"<Preset #393 My demo plan>",
"<Preset #391 Default>"
],
"dvr_depth": [
3.0,
null
],
"dvr_space": [
6,
null
],
"preset_id": [
393,
391
]
}
},
"action_type": "change",
"object_repr": "<CloudStream cam-10-9bdbc979dd>",
"object_type": "Camera",
"request_data": {
"ip": "188.242.170.19,188.242.170.19",
"user_agent": "PostmanRuntime/7.32.1"
}
},
"motion_detector_enabled": false,
"name": "cam-10-9bdbc979dd",
"onvif_ptz": false,
"organization_id": 774,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"playback_config": {
"token": "3.sJXDwZNHAAAAAAAAAAAAAAAAAAAAj2eRzt7bH5sYfDpRVJ4jlfvwAO4o"
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "cam-10-9bdbc979dd",
"server": "eu-004.vscdn.io",
"alive": true,
"lifetime": 730640,
"bitrate": 194,
"source_error": null,
"http_port": null,
"https_port": null
},
"stream_url": "fake://fake",
"streamer_hostname": "eu-004.vscdn.io",
"provision_required": false,
"substream_url": "",
"thumbnails": false,
"title": "cam-10",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
}
Disable the camera¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X PUT 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras/OBJECT-ID'
--data '{"enabled": false}'
where:
YOUR-DOMAIN-NAME
is the domain name.OBJECT-ID
is the camera ID. Find out the camera ID using GET /vsaas/api/v2/cameras or GET /vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID.
Response example:
{
"comment": "",
"coordinates": "",
"enabled": false,
"folder_id": 1156,
"groups": [],
"has_actions": false,
"last_change": {
"user": "domain_143_via_apikey",
"domain_id": 143,
"object_id": "demo-cam-219c36899q",
"created_at": 1715103531,
"event_data": {
"changed_data": {
"_enabled": [
true,
false
]
}
},
"action_type": "change",
"object_repr": "<CloudStream demo-cam-219c36899q>",
"object_type": "Camera",
"request_data": {
"ip": "188.242.169.75,188.242.169.75",
"user_agent": "PostmanRuntime/7.32.1"
}
},
"motion_detector_enabled": false,
"name": "demo-cam-219c36899q",
"onvif_ptz": false,
"organization_id": 753,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"playback_config": {
"token": "3.sJXDwZNHAAAAAAAAAAAAAAAAAAAj5fUIZsybhtcpRTPPwzvGGht3iDs"
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "demo-cam-219c36899q",
"server": null,
"alive": false,
"lifetime": null,
"bitrate": null,
"source_error": "no_stream_status",
"http_port": null,
"https_port": null
},
"stream_url": "fake://fake",
"streamer_hostname": "eu-004.vscdn.io",
"provision_required": false,
"substream_url": "",
"thumbnails": false,
"title": "demo-cam",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
}
Enable the camera¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X PUT 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/cameras/OBJECT-ID'
--data '{"enabled": true}'
where:
YOUR-DOMAIN-NAME
is the domain name.OBJECT-ID
is the camera ID. Find out the camera ID using GET /vsaas/api/v2/cameras or GET /vsaas/api/v2/cameras?organization_id=ORGANIZATION-ID.
Response example:
{
"comment": "",
"coordinates": "",
"enabled": true,
"folder_id": 1156,
"groups": [],
"has_actions": false,
"last_change": {
"user": "domain_143_via_apikey",
"domain_id": 143,
"object_id": "demo-cam-219c36899q",
"created_at": 1715128546,
"event_data": {
"changed_data": {
"_enabled": [
false,
true
]
}
},
"action_type": "change",
"object_repr": "<CloudStream alexandra-bikbaeva-cam-227c37899f>",
"object_type": "Camera",
"request_data": {
"ip": "188.242.170.19,188.242.170.19",
"user_agent": "PostmanRuntime/7.32.1"
}
},
"motion_detector_enabled": false,
"name": "demo-cam-219c36899q",
"onvif_ptz": false,
"organization_id": 753,
"permissions": {
"view": true,
"edit": true,
"ptz": true,
"dvr": true,
"dvr_depth_limit": null,
"actions": true
},
"playback_config": {
"token": "3.sJXDwZNHAAAAAAAAAAAAAAAAAAAAj5fUIZsqbhtcpRTPPszvGGht3iDs"
},
"postal_address": "",
"precise_thumbnails_days": 0,
"preset": {
"domain_id": 143,
"dvr_depth": 0.0,
"id": 391,
"is_adjustable": false,
"is_default": true,
"is_deleted": false,
"precise_thumbnails_days": 0,
"title": "Default",
"vision_params": {}
},
"preset_id": 391,
"static": true,
"stream_status": {
"name": "demo-cam-219c36899q",
"server": null,
"alive": true,
"lifetime": 145967640,
"bitrate": 202,
"source_error": null,
"http_port": null,
"https_port": null
},
"stream_url": "fake://fake",
"provision_required": false,
"substream_url": "",
"thumbnails": false,
"title": "demo-cam",
"user_attributes": {
"favorite": false,
"motion_alarm": false
},
"video_only": false,
"transcode_audio": false
}
Users¶
Managing users in cloud.vsaas.io.
Get a list of all users¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/users'
where YOUR-DOMAIN-NAME
is the domain name.
Response example:
[
{
"id": 1297,
"domain_id": 111,
"login": "demo@example.org",
"apikey": "ajG3NIzOt2CjUyRoWyVeh2U9",
"is_admin": false,
"authorized_ip": null,
"enabled": true,
"readonly": false,
"monitoring": false,
"name": null,
"locale": "",
"note": null,
"phone": null,
"notification_email": null,
"external_id": null,
"max_sessions": null,
"can_edit_organizations": false,
"can_edit_settings": true,
"can_view_organizations": true,
"organizations": [
752,
753
]
},
{
"id": 1298,
"domain_id": 111,
"login": "another-demo@example.org",
"apikey": null,
"is_admin": false,
"authorized_ip": null,
"enabled": true,
"readonly": false,
"monitoring": false,
"name": "",
"locale": "en",
"note": "",
"phone": null,
"notification_email": null,
"external_id": null,
"max_sessions": null,
"can_edit_organizations": false,
"can_edit_settings": false,
"can_view_organizations": false,
"organizations": [
753,
762
]
},
...
Create a user¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X POST 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/users'
--data-raw '{
"login": "user@example.com",
"password": "qwe123"
}
'
where:
login
is the unique username.password
is the password for the user.
Response example:
{
"id": 1377,
"domain_id": 143,
"login": "user@example.com",
"apikey": null,
"is_admin": false,
"authorized_ip": null,
"enabled": true,
"readonly": false,
"monitoring": false,
"name": null,
"locale": "",
"note": null,
"phone": null,
"notification_email": null,
"external_id": null,
"max_sessions": null,
"can_edit_organizations": false,
"can_edit_settings": false,
"can_view_organizations": false,
"organizations": [
752
]
}
The new user is automatically assigned to the default Unassigned cameras
organization.
Remove a user¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-X DELETE 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/users/USER-ID'
where YOUR-DOMAIN-NAME
is the domain name.
Response:
{
"success": true
}
Organizations¶
Managing organizations in cloud.vsaas.io.
Get a list of all organizations¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations'
where YOUR-DOMAIN-NAME
is the domain name.
Response example:
[
{
"domain": {
"title": "YOUR-DOMAIN-NAME",
"id": 143
},
"title": "My organization",
"mosaic_count": 0,
"camera_count": 4,
"owner": {
"login": "demo@example.org",
"id": 1179
},
"can_view_stats": true,
"can_edit_cameras": true,
"camera_limit": 1000,
"dvr_limit": 100,
"can_edit_users": true,
"id": 753,
"user_count": 2,
"is_member": false,
"user_limit": 1000,
"is_default": false
},
{
"domain": {
"title": "YOUR-DOMAIN-NAME",
"id": 143
},
"title": "Unassigned cameras",
"mosaic_count": 0,
"camera_count": 2,
"owner": {
"login": "demo@example.org",
"id": 1179
},
"can_view_stats": true,
"can_edit_cameras": true,
"camera_limit": 1000,
"dvr_limit": 100,
"can_edit_users": true,
"id": 752,
"user_count": 1,
"is_member": false,
"user_limit": 1000,
"is_default": true
}
]
Get a list of all available billing plans for the organization¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/presets'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.
Response example:
[
{
"organization_id": null,
"preset": {
"dvr_depth": 0.0,
"dvr_lock_days": null,
"vision_params": {},
"vision_gpu": null,
"vision_alg": null,
"is_deleted": false,
"vision_enabled": null,
"is_adjustable": false,
"precise_thumbnails_days": 0,
"id": 391,
"title": "Default",
"dvr_space": null,
"vision_areas": null
},
"domain_id": 143,
"id": null,
"preset_id": 391
}
]
Users in organization¶
Managing users in organization in cloud.vsaas.io.
Get a list of all users of the organization¶
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/users'
where:
YOUR-DOMAIN-NAME
is the domain nameORGANIZATION-ID
is the organization ID assigned when creating the organization.
Response example:
[
{
"notification_email": null,
"can_view_organization_stats": true,
"can_view_organization_plists": true,
"login": "demo@example.org",
"can_edit_organization_cameras": true,
"can_edit_organization_plists": true,
"user_id": 1297,
"folders_permissions": [],
"can_edit_organization_users": true
},
{
"notification_email": null,
"can_view_organization_stats": false,
"can_view_organization_plists": false,
"login": "demo-2@example.com",
"can_edit_organization_cameras": false,
"can_edit_organization_plists": false,
"user_id": 1377,
"folders_permissions": [],
"can_edit_organization_users": false
}
]
Assign the user with read-only permissions to the organization¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X POST 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/users'
--data '{
"user_id": 1378
}'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.user_id
is the user ID assigned when creating the user.
Response example:
{
"notification_email": null,
"can_view_organization_stats": false,
"can_view_organization_plists": false,
"login": "viewer@example.com",
"can_edit_organization_cameras": false,
"can_edit_organization_plists": false,
"user_id": 1378,
"folders_permissions": [],
"can_edit_organization_users": false
}
The user has no permissions, not even the permission to view cameras: "folders_permissions": []
.
Assign the user with permissions to edit the camera to the organization¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X POST 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/users'
--data '{
"user_id": 1377,
"can_edit_organization_cameras": true
}'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.user_id
is the user ID assigned when creating the user.
Response example:
{
"notification_email": null,
"can_view_organization_stats": false,
"can_view_organization_plists": true,
"login": "installer@example.com",
"can_edit_organization_cameras": true,
"can_edit_organization_plists": true,
"user_id": 1377,
"folders_permissions": [],
"can_edit_organization_users": false
}
The user doesn't have the permission to view cameras: "folders_permissions": []
.
Remove users from the default organization¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-X DELETE 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID//users/USER-ID'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.USER-ID
is the user ID assigned when creating the user.
Response:
{
"success": true
}
Folders in organizations¶
Managing folders in organizations in cloud.vsaas.io.
Get a list of all folders of the organization¶
All cameras belong to some folder. That is, there are no cameras outside of folders. When you create an organization, the default folder Cameras
is created.
curl -H "x-vsaas-api-key: VSAAS-USER-API-KEY" \
-X GET 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/folders'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.
Response example:
[
{
"level": 0,
"camera_count": 4,
"organization_id": 753,
"parent_id": null,
"map_topleft": null,
"id": 1156,
"title": "Cameras",
"map_bottomleft": null,
"order_num": 1,
"map_topright": null,
"coordinates": null
}
]
Grant permissions for users in a specific folder in the organization¶
curl -H "x-vsaas-api-key: VSAAS-ADMIN-API-KEY" \
-H 'Content-Type: application/json' \
-X POST 'https://YOUR-DOMAIN-NAME.vsaas.io/vsaas/api/v2/organizations/ORGANIZATION-ID/folders/FOLDER-ID/users'
--data '{
"user_id": 1378,
"can_view_dvr": 1,
"can_use_ptz": 1,
"can_use_actions": 1,
"dvr_depth_limit": null
}'
where:
YOUR-DOMAIN-NAME
is the domain name.ORGANIZATION-ID
is the organization ID assigned when creating the organization.FOLDER-ID
is the ID of the folder with cameras.
Response example:
{
"can_use_ptz": true,
"can_use_actions": true,
"user_id": 1378,
"can_view_dvr": true,
"dvr_depth_limit": null
}