# Salesforce Outbound Messages

## Dispatch Surveys

<mark style="color:green;">`POST`</mark> `https://api.feedbackly.com/v5.0.3/triggers/soap/:apiActionId`

Simply send your contacts as outbound messages to send surveys.

Get in touch with Feedbackly Support to map necessary fields, e.g. email info so Feedbackly can use this information to send the surveys and manage unsubscriptions.

Dispatch API have rate limit of 500 contacts/minute. Please be careful with retries since we're sending out surveys right away after receiving the API request. \
\
\*Refer to "[Preparing Campaign](https://docs.feedbackly.com/dispatch-api/preparing-campaign)" to get apiActionId from feedbackly dashboard.

#### Headers

| Name          | Type   | Description                                                                                          |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| Authorization | String | <p>Authentication token to access the API eg:<br>'Authorization': 'ey0iuefoo834xcunerun348efnsd'</p> |
| Content-Type  | String | Use: 'Content-Type':'application/json'                                                               |

#### Request Body

| Name                                       | Type       | Description                                                                                                    |
| ------------------------------------------ | ---------- | -------------------------------------------------------------------------------------------------------------- |
| actionId<mark style="color:red;">\*</mark> | String     | Unique identifier to differentiate original requests. Feedbackly will block requests with duplicate actionIds. |
| contacts<mark style="color:red;">\*</mark> | contact\[] | Array of [contact object](#contact)s                                                                           |
| ~~apiActionId~~                            | String     | \[DEPRECIATED] ApiActionId to be used in body instead of URI param                                             |

{% tabs %}
{% tab title="Request (POST)" %}

```
{
  "actionId": "123456789",
  "contacts": [
    {
    "email": "some.user@example.com",
    "metadata": {
      "type": "Test"
      }
    }
  ]
}
```

{% endtab %}

{% tab title="200 Response successfully retrieved." %}

```
{
    "campaigns": {
        "65f16af0d948b98372d6b6aa": [
            {
                "email": "some.user@example.com",
                "metadata": {
                    "type": "Test"
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### Contact Object <a href="#contact" id="contact"></a>

Please note that either email or phone must be existing per contact. Metadata and options are optional.

| Field    | Type                              | Description                                                                                   |
| -------- | --------------------------------- | --------------------------------------------------------------------------------------------- |
| email    | String                            | Valid email address of survey receiver                                                        |
| phone    | String                            | Valid phone number with country code of survey receiver. (with or without + in the beginning) |
| metadata | {\[key:string]: string \| number} | Contact related metadata.                                                                     |
| options  | {}                                | Additional options                                                                            |

#### Options

To override default admin notification receivers, use this. Multiple emails can be specified as an array.

```
"options":{
	"notificationReceiver":["other.email@example.com"],
	"overrideDefaultReceivers":true
}
```


---

# 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://docs.feedbackly.com/dispatch-api/responses/get-responses-1.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.
