# Responses

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 <a href="#get" id="get"></a>

***

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 <a href="#put-post-delete" id="put-post-delete"></a>

***

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

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://api.impact.com/Agencies/<AccountSID>/Advertisers' \
	-H 'Accept: application/json'
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="JSON" %}

```json
// OK Response
HTTP/1.1 200 OK
{
  "Status": "OK",
  "Uri": "/Advertisers/<AccountSID>/Ads/656565"
}

// Queued Response
HTTP/1.1 200 OK
{
  "Status": "QUEUED",
  "QueuedUri": "/Advertisers/<AccountSID>/APISubmissions/A-1234bcd5-6789-0123-e45f-6g789hijklm0"
}
```

{% endtab %}

{% tab title="XML" %}

```xml
<!--OK Response-->
HTTP/1.1 200 OK
<ImpactRadiusResponse>
	<Status>OK</Status>
	<Uri>/Advertisers/AccountSID/Actions/test123</Uri>
</ImpactRadiusResponse>

<!--Queued Response-->
HTTP/1.1 200 OK
<ImpactRadiusResponse>
  <Status>QUEUED</Status>
    <QueuedUri>/Advertisers/AccountSID/QueuedStatus/test123</QueuedUri>
</ImpactRadiusResponse>
```

{% endtab %}
{% endtabs %}

| <p><br><em>OK</em></p> | 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. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.impact.com/agency-v3/agency-v2/readme/responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
