Message-ID: <1635517348.15789.1614958159023.JavaMail.confluence@wiki> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15788_1128751314.1614958159022" ------=_Part_15788_1128751314.1614958159022 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The body of the API's HTTP response is XML describing either the errors = encountered, or the result of a successful request.
All response bodies contain a 'response' tag with a 'processed_date' att= ribute. The results are contained within the 'response' tag. The 'processed= _date' attribute contains the date that the request was processed by the se= rver, in ISO 8601 format.
An error response body might look like this:
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?&= gt; <!DOCTYPE response PUBLIC "-//textmarketer.co.uk//DTD Web Services REST 1.6//EN" "http://api.textmarketer.co.uk/services/rest/DTD/errors.dtd"> <response processed_date=3D"2011-04-12T14:02:00+01:00"> <errors> =09<error code=3D"404">Not Found (ERR255)</error> </errors> </response>=20
You can see that the XML above contains a list of errors - in this case = only one. The error codes will be specific to the nature of the error. In t= his case we attempted to access a resource that doesn't exist. So the error= code is the same as the response header status code 404, meaning 'resource= not found'. However error codes are sometimes specific to the resource bei= ng called. For example, the sms resource might return errors like this= :
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?&= gt; <!DOCTYPE response PUBLIC "-//textmarketer.co.uk//DTD Web Services REST 1.6//EN" "http://api.textmarketer.co.uk/services/rest/DTD/errors.dtd"> <response processed_date=3D"2011-04-12T14:12:04+01:00"> <errors> =09<error code=3D"10">invalid number or not an integer</= error> =09<error code=3D"9">invalid number or too short</error&= gt; =09<error code=3D"7">invalid message or missing</error&g= t; =09<error code=3D"4">invalid originator or missing</erro= r> </errors> </response>=20
In this case, no data was passed to the resource except for the username=
and password. The errors therefore describe problems with the data passed,=
like the 'message' parameter is missing.
The error codes below 2=
00, and all error messages, are specific to the resource and are detailed f=
urther below.
DTD
The DTD of the error response is included below for your reference.
<?xml version=3D"1.0" encoding=3D"UTF-8"?> <!-- =09PUBLIC ID : -//textmarketer.co.uk//DTD Web Services REST 1.6//EN =09SYSTEM ID : http://api.textmarketer.co.uk/services/rest/DTD/errors.dtd --> <!ELEMENT response (errors)> <!ATTLIST response processed_date CDATA #REQUIRED > <!ELEMENT errors (error?)> <!ELEMENT error (#PCDATA) > <!ATTLIST error code CDATA #REQUIRED >=20