Contents

Responses are sent for:

  • confirmation of API call
  • error messages
  • returned data

Responses are returned in either JSON or XML format.

The default is JSON, the format is specified in the URL after the api Function call:.

JSON Response Format

Responses are in standard JSON format. The response contains pairs for:

  • status – ok or error
  • details
  • returned values

Examples

{“status”:”ok”,”detail”:”Success”}
{“status”:”error”,”detail”:”Contact already exists”}

If the call contains multiple lists, there will be responses for the contact and each list. These will be returned in a JSON array, for example:

[
{“email_address”:”test@x.co.uk”,”status”:”ok”, “detail”:”Success”},
{“list”:”Sales”,”status”:”ok”,”detail”:”Success”},
{“list”:”fred”,”status”:”error”,”detail”:”List not found”}
]

{“status”:”error”,”detail”:”Contact already exists”}

XML Response Format

The response is returned in XML elements. As for JSON, the response contains elements to identify the API call, status, details and data values.

Examples

<ARPapi>
 <response>
   <email_address>test@x.co.uk</email_address>
   <status>ok</status>
   <detail>Success</detail>
 </response>
</ARPapi>
<ARPapi>
 <response>
   <email_address>test@x.co.uk</email_address>
   <status>ok</status>
   <detail>Success</detail>
 </response>
 <response>
   <list>Sales</list>
   <status>ok</status>
   <detail>Success</detail>
 </response>
 <response>
   <list>east</list>
   <status>error</status>
   <detail>invalid list format</detail>
 </response>
 <response>
   <list>fred</list>
   <status>error</status>
   <detail>List not found</detail>
 </response>
</ARPapi>