---
schema_version: "1"
id: c6114b388a669de05a24ad02f8d071a263882c9da24bceb2a334578c25a92532
title: Callback Handling for Asynchronous Calls
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-apis/asynchronous_processing_callback.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/asynchronous_processing_callback.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6736eb5da3c44832cfd64db2261ab1cebb0ba7b781673b9d1398359f1b402049
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Callback Handling for Asynchronous Calls

When you submit an asynchronous request, you can configure the [Options](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/asynchronous_processing_options_object.md) object to return the result as an HTTP POST callback or as an email. Alternatively, you can submit a `Retrieve` request to get `ResultMessage` objects and filter the results by the `ResultID` of the original request. To ensure that you receive responses quickly and reliably, we recommend that you configure asynchronous requests to return HTTP POST callbacks.

To use a callback to return results, set the value of the `SendResponseTo.ResponseType` property to `HTTPPost`. Next, specify a publicly accessible HTTPS URL for the value of the `SendResponseTo.ResponseAddress` property. The callback URL receives an HTTP POST request that uses the `application/x-www-form-urlencoded` content type and contains these fields.

- `RequestID`
- `ConversationID`
- `OverallStatusCode`
- `StatusCode`
- `StatusMessage`
- `ErrorCode`
- `RequestType`
- `ResultType`
- `ResultDetailXML`
- `SequenceCode`

If an HTTP POST callback results in an exception, the system logs an error and stops the process. Callbacks aren’t retried.

## Reduce the Number of Callbacks

The callbacks that you receive correspond to the number of requests that you make. If you send 750 asynchronous SOAP requests, the system sends 750 POST requests to the callback URL. To reduce the number of callbacks, you can configure your requests to send multiple objects in a single call. You can also configure requests so that the system only sends callbacks when an error occurs.

If your request includes a `RequestExpirationTime`, add a `SendResponseTo` object that includes the `RespondWhen.OnExpired` property.

## Sample SOAP Envelope - Retrieve ResultMessage Object

<!-- Moved Gist inline (mc-doc/795d125a0a3ee8f9e00baf4ed035ed30) -->

```xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>XXXXX</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>ResultMessage</ObjectType>
            <Properties>RequestID</Properties>
            <Properties>StatusCode</Properties>
            <Properties>StatusMessage</Properties>
            <Properties>RequestType</Properties>
            <Properties>ConversationID</Properties>
            <Properties>OverallStatusCode</Properties>
            <Properties>ResultDetailXML</Properties>
            <Properties>CreatedDate</Properties>
            <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
               <Property>RequestID</Property>
               <SimpleOperator>equals</SimpleOperator>
               <Value>YOUR_REQUEST_ID</Value>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>
```

## Sample SOAP Envelope - Return HTTP POST

<!-- Moved Gist inline (mc-doc/e3c786b4758e200751154e238bf0a977) -->

```xml
<Options>
   <SendResponseTo>
      <ResponseType>HTTPPost</ResponseType>
      <ResponseAddress>http://www.example.com/AsyncReturn.php</ResponseAddress>
      <RespondWhen>OnCallComplete</RespondWhen>
      <IncludeResults>true</IncludeResults>
      <IncludeObjects>true</IncludeObjects>
   </SendResponseTo>
   <ConversationID>TestConversationID</ConversationID>
   <OrdinalID>0</OrdinalID>
   <RequestType>Asynchronous</RequestType>
</Options>
```
