Calling the Omnichannel API

End Points

The following endpoints (URLs) are available for the Omnichannel API for HTTP POSTing to.

πŸ“˜

Which method to use?

Use the batch submission if you have more than one message to send at a time, otherwise use the single submission.

Single Message Submission

The endpoint for the web service is: https://{region}-api.dotmailer.com/cpaas/messages

Send a single message request object using JSON e.g.

{
  "body": "Sending messages is easy!",
  "to": {
    "phoneNumber": "447123123123"
  },
  "rules": [
    "sms"
  ]
}

You can find more details about the endpoint here, but please read this section first so that you are familiar with how the API works.

Batch Message Submission

The endpoint for the web service is: https://{region}-api.dotmailer.com/cpaas/messages/batch

Send a batch of message request objects using a JSON array e.g.

[
  {
    "body": "This is message 1",
    "to": {
      "profileId": "[email protected]",
      "phoneNumber": "447123123123"
    },
    "rules": [
      "fbMessenger",
      "sms"
    ]
  },
  {
    "body": "This is message 2",
    "to": {
      "profileId": "[email protected]",
      "phoneNumber": "447234234234"
    },
    "rules": [
      "fbMessenger",
      "sms"
    ]
  }
]

You can find more details about the end point here, but please read this section first so that you are familiar with how the API works.

πŸ“˜

Find out more about regional endpoints

Ensure you understand what region you need to call by reading this guidance

Content Type

The content type for the HTTP requests should be set to application/json using the Content-Type HTTP header:

Content-Type: application/json

Security

Secure communications

The Omnichannel API is only accessible via secure communications using 2048 bit TLS encryption.

Authorizing web service calls

To call the services you will need to use HTTP Basic Authorization, passing a valid set of Dotdigital API credentials.

POST /cpaas/messages HTTP/1.1
Host: api-cpaas.dotdigital.com
Authorization: Basic eyJhbGciOiJIUzI
Content-Type: application/json

πŸ“˜

Need a API credentials?

If you need to create an API User for your Dotdigital account follow these instructions.

πŸ“˜

Want a code example for sending an SMS and more?

Check out our Send an SMS recipe