Error Code and Message Format

Server returns different format for error code and messages according to different "Accept" value in request header.

Accept header and data format
Type and Format Accept header samples Response body
XML application/xml, application/xhtml+xml, application/atom+xml
Note: If error occurs in an OData request, include (xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata") namespace, otherwise not.
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code>403</code> <message xml:lang="en-US">some specific error text string</message> </error>
JSON application/json, text/json { "error": {"code": "403", "message": {"lang": "en-US", "value": "some specific error text string" } } }
TEXT text/html, text/plain "some specific error text string"
Note: If the Accept header does not include any of these data types, the response body is null.