The default format is XML
. To get a JSON
response add a .json
extension to the resource name or
set the Accept
header to application/json
.
The root element of the XML response is <ImpactRadiusResponse>
, which is common to all resources. Also, each resource representation has a self-referencing URI (i.e. the URI used to retrieve it). This is an aspect of the REST's Hypermedia References (see below).
GET
The response formats are different for the GET
versus the POST
, PUT
, and DELETE
requests. GET
requests contain a full representation of the resource requested. Each resource has different representations which are detailed in their respective sections below.
PUT, POST, DELETE
Unlike the GET
response, the response for POST
, PUT
, and DELETE
will only contain a Status
as well as a URI
pointing to where more details for the entity referenced can be found. For resources that execute immediately, the URI
will represent the corresponding GET
request for that entity. Resources that require more intensive processing will queue the request and return a QueuedURI
where details about the status of the request can be found.
Example Request
curl 'https://api.impact.com/Mediapartners/<AccountSID>/Actions' \
-H 'Accept: application/json'
Example Responses
// OK Response
HTTP/1.1 200 OK
{
"Status": "OK",
"Uri": "/Mediapartners/<AccountSid>/Campaigns/1234"
}
// Queued Response
HTTP/1.1 200 OK
{
"Status": "QUEUED",
"QueuedUri": "/Mediapartners/<AccountSID>/APISubmissions/A-1234bcd5-6789-0123-e45f-6g789hijklm0"
}
<!--OK Response-->
HTTP/1.1 200 OK
<ImpactRadiusResponse>
<Status>OK</Status>
<Uri>/Mediapartners/AccountSID/Actions/test123</Uri>
</ImpactRadiusResponse>
<!--Queued Response-->
HTTP/1.1 200 OK
<ImpactRadiusResponse>
<Status>QUEUED</Status>
<QueuedUri>/Mediapartners/AccountSID/QueuedStatus/test123</QueuedUri>
</ImpactRadiusResponse>
OK | Everything worked as expected and the request was completed immediately. |
QUEUED | Everything worked as expected and the request was queued for processing. |
ERROR | Something went wrong and the request was not processed. Check the Message field for more details. |