API's response format is JSON by default. To request output in XML, add parameter responseType=XML
to your call.
For example, API call verifyUser, with the following input parameters:
clientCode=...
username=...
password=...
responseType=XML
returns an XML document:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<status>
<request>verifyUser</request>
<requestUnixTime>...</requestUnixTime>
<responseStatus>ok</responseStatus>
<errorCode>0</errorCode>
<generationTime>...</generationTime>
<recordsTotal>1</recordsTotal>
<recordsInResponse>1</recordsInResponse>
</status>
<records>
<item>
<userID>6</userID>
<userName>demo</userName>
<employeeID>4</employeeID>
<employeeName>Clara Smith</employeeName>
<groupID>7</groupID>
<groupName>sales representatives</groupName>
<sessionKey>...</sessionKey>
<sessionLength>3600</sessionLength>
<loginUrl>...</loginUrl>
</item>
</records>
</document>
Additionally, add input parameter sendContentType=1
to every API call. This ensures that server will respond with an appropriate Content-Type header:
application/json; charset=UTF-8
for JSON;application/xml; charset=UTF-8
for XML.For backward compatibility reasons, API cannot return that header by default.