3.1. Common Changes

Top  Previous  Next

Supported versions.

XML API 1.x version is not supported anymore. XML API 2.x and 3.x. are partially supported for compatibility.

Request format

In the Web API 4.1.3 version, script path does not contain a version number.

Example:

Request parameters

All scripts accept a following parameter: format = [ json | xml ];

In the XML API 3.x version, the flags could take values: yes, no, on, off. In Web API 4.1, only the yes and no values can be taken.

Response format

Web API support two types of response documents: XML and JSON.

By default, XML response is sent. To receive a response in JSON format, add the format=json attribute to the request or send the x‑drweb‑api‑response‑type HTTP response header with the json value.

HTTP response headers

The following HTTP response headers are added to all the responses:

x‑drweb‑srv‑type = AVDesk

x‑drweb‑srv‑version = [Server version including the build number in the number format, for example: 100000201409090]

x‑drweb‑api‑version = [Web API version in the number format, for example: 040100]

x‑drweb‑srv = [Server identifier]

x‑drweb‑api‑status = [ true | false ]

Operation status, true—successfully executed, false—returned error.

XML response

The following attributes of the <drweb-avdesk-api /> element are removed : api_build, local_timestamp, srv_branch, operation.

Error Handling

In case of an error, both at the user side and an internal one, x‑drweb‑api‑status response header takes false value, and status response header takes one of the following values:

200 OK—when an error occurrs at the user side, for example, an incorrect argument is sent or a chosen object does not exist;

401 Unauthorized—when the administrator does not have access privileges to the requested source or an authorization error occurs;

404 Resource Not Found—when a requested source is not found (request path error);

500 Internal Error—when an internal error occurs.

The DW_AVD_ prefix is removed from the error codes.