Error codes

HTTP Status Codes

The Webservices use HTTP status codes to inform the client application about the response.

CodeTextDescription
200OKSuccessful response
400BadRequestThe request was invalid. The accompanying message can explain why.
401UnauthorizedThe user is not authorized for this service. The accompanying message can explain why or what service. 
500InternalServerErrorAn unexpected error has occurred. Contact us with the error number from the message
   

Error message

In addition to the http status code, a message containing extra information is sent to the application. This message consists of the fields IsError (boolean), ErrorMessage (string) and Status (string). The Error Message contains information that may help troubleshoot the issue. The Status field contains a textual representation of the http status code.

Example:

{
 "IsError": true
 "ErrorMessage": "Incorrect format for featureFilter: {\"EF001360\":\"EV000278\" fzljk dfjf l;j a }",
 "Status": "BadRequest"
}<br><br>

 JSONP

It is not possible to filter the response based on HTTP status codes if jsonp was used to invoke the services. In this case, you can make use of the returned data object.

Example:

callback(
    {"IsError":true
      ,"ErrorMessage":"Incorrect format for featureFilter:{\"EF003356\":\"EV005821"
      ,"Status":"BadRequest"
    }
    ,400
);
//Callback function
function callback(data) {
    if (data.IsError) {
        alert(data.Status + ': ' + data.ErrorMessage);
    } else {
     // Do something with data
    }
}
This site is registered on wpml.org as a development site.