Documentation

Error handling

When calling a method, errors and warnings may occur:

  • Errors that prevent the request from being executed: invalid request format (including omission of a required parameter), invalid token, API server unavailable, and so on.

  • Errors and warnings when performing an action with one of the objects in the request that do not affect the success of the operation with other objects. For more information about operation errors, see the section Operations on object arrays.

Codes and descriptions for errors and warnings are listed in the section Errors and warnings.

Note. The language for error messages is defined in the Accept-Language request header.

Request execution errors

If the request cannot be executed, the following structure is returned:

<SOAP-ENV:Fault>
  <faultcode>SOAP-ENV:Client</faultcode>
  <faultstring
[no-highlight[

Textual message about the error.

]no-highlight]
>(string)</faultstring> <detail
[no-highlight[

Information about the error.

]no-highlight]
> <ns3:FaultResponse xmlns:ns3="http://direct.yandex.com/api/v5/general"> <requestId
[no-highlight[

Unique request ID assigned by the Yandex.Direct API server. It is also passed in the Request-ID HTTP header.

]no-highlight]
>(string)</requestId> <errorCode
[no-highlight[

Numeric error code.

]no-highlight]
>(int)</errorCode> <errorDetail
[no-highlight[

Detailed description of the error.

]no-highlight]
>(string)</errorDetail> </ns3:FaultResponse> </detail> </SOAP-ENV:Fault>
Parameter Type Description
Fault object
faultstring stringTextual message about the error.
detail ApiExceptionMessage Information about the error.
ApiExceptionMessage object
requestId stringUnique request ID assigned by the Yandex.Direct API server. It is also passed in the Request-ID HTTP header.
errorCode intNumeric error code.
errorDetail stringDetailed description of the error.
{
  "error" : {
    "request_id
[no-highlight[

Unique request ID assigned by the Yandex.Direct API server. It is also passed in the RequestId HTTP header.

]no-highlight]
": (string), "error_code
[no-highlight[

Numeric error code.

]no-highlight]
": (int), "error_string
[no-highlight[

Textual message about the error.

]no-highlight]
": (string), "error_detail
[no-highlight[

Detailed description of the error.

]no-highlight]
": (string) } }
Parameter Type Description
request_id stringUnique request ID assigned by the Yandex.Direct API server. It is also passed in the RequestId HTTP header.
error_code intNumeric error code.
error_string stringTextual message about the error.
error_detail stringDetailed description of the error.