To receive a response in the JSON format, add the format=json attribute to the request like the following:
http://<host>:9080/api/<object>/<script>.ds?<parameters>&format=json
|
or
https://<host>:9081/api/<object>/<script>.ds?<parameters>&format=json
|
where:
<host>—IP address or DNS name of a computer with the Server installed
<object>—managing object: station, group, Server, administrator, Quarantine.
Available scripts and their parameters are described in the following sections
•Stations Handling •Groups Handling •Server Handling •Administrators Handling •Quarantine Handling
|
The ‘-’ character in the script name can be replaced with ‘_’. For example, responses to requests using the scripts installed-components.ds and installed_components.ds will be the same.
|
You can receive a JSON response for any URL request that is supported by the Web API 4.3.0.
JSON document contains the following elements:
•the head block—service information. •the data block—response data. Content depends on executing operation. Elements of the head block:
Field name
|
Description
|
status
|
Request status. Request status: true—a request has been processed successfully, false—an error occurred, a request has not been processed.
|
timestamp
|
GMT time of server (Unix timestamp format)
|
version in the api block
|
Current Web API version
|
versionString in the api block
|
Current Web API version in strings format
|
name in the server block
|
Server domain name or IP address
|
version in the server block
|
Full version of Dr.Web Web API for Enterprise Security Suite
|
uuid in the server block
|
Server identifier
|
If an error occurred during operation("status":false), then the error block containing an error text and code will be included in the JSON body. An error is described in the message field while an error code is in the code field.
{ "head": {
"status": false,
"timestamp": 1550867853,
"api": {
"version": 40300,
"versionString": 4.3.0},
"server": {
"name": "192.168.1.1",
"version": "12.00.0.201909260",
"uuid": "27671337-e0b0-4f60-aeb0-ab1f2ca47f77"}},
"data": {
"error": {
"code": 11,
"message": "Necessary parameters are not specified in your request: 'name'"}}}
|
Error codes are given in the Returned error codes section.
Date and time in all elements of Web API 4.3.0 scripts are returned in the Unix timestamp format.
|