Skip to main content
Skip table of contents

API genеral description

General description

API (Application Programming Interface) is a set of rules, methods, and functions that enable different software applications to communicate with each other. An API defines how applications can request and receive data, as well as perform specific actions. It includes:

  • Operations to be performed (methods). This refers to the set of actions or tasks that an application can carry out through the API.

  • Requests. This is the information that an application sends to the API to initiate a specific operation. It could be in the form of parameters, arguments, or data structures.

  • Responses. This is the information that the API sends back to the application in response to a request. This could be the requested data, a status indicating whether the operation was successful, or error messages if something went wrong.

The VSaaS product API is built on REST.

A REST API serves as the primary communication channel between server-side and client-side applications. The server-side application exposes its data to the client-side application via a specific URL.

All requests should contain the following header: Content-Type: application/json. This is necessary for the server (backend) to understand whether the client supports JSON-formatted responses. If this header is missing, the server might return a response in an incompatible format – errors could be returned as an HTML page.

Authentication

To carry out API requests, authorization is required. Authorization is done with an API Access Token. For details on how to get the API token, see this API authorization guide.

Sharing of your token with third parties may result in the loss of your data and service instability.

Once an API Access Token is received, all subsequent requests should include this token either in the HTTP header or as a URL parameter.

Example

CODE
Authorization:  3rADAV_TZTh4eD4SCvb-dYHy-SMw76X5NB2hTLfm0G6iXeTMCxhE
BASH
curl --cacert /opt/ssl/navek.dev/fullchain.cer --request POST \
	--url 'https:/mediaserver.vsaas.com:8776/api/' \
	--header 'Content-Type: application/json' \
	--header 'Host: http://192.168.200.31:8666' \
	--header 'Accept: application/json' \
	--header 'Authorization: Bearer 3rADAV_TZTh4eD4SCvb-dYHy-SMw76X5NB2hTLfm0G6iXeTMCxhE' \
	--data '{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Ranges",
    "params": [
        "camera-uid5065687-primary"
    ],
    "id": 1
}'

 

Requests will return the 401 Unauthorized error in the following cases:

  • No authorization token is submitted.

  • The submitted token is invalid.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.