Additional options

Setting Expiry

For time sensitive messages you can specify a expiry date and time where we won't deliver your message after. Where a channel supports message expiry the expiry time will be passed on automatically.

To set an expiry set the following property:

PropertyTypeDescription
expiresOndate-timeDate/Time (in UTC, ISO 8601 format)

🚧

SMS Expiry times

Please ensure that your expiry time is more than 1 minute from the current UTC time, as when processed if the time difference between UTC and the expiry time is less than a minute then the default expiry will be applied. 1 minute is the minimum validity for an SMS expiry.

{
  "body": "Test from the One API",
  "to": {
    "phoneNumber": "447123123123"
  },
  "expiresOn": "2017-03-16T17:05:02Z",
  "rules": [
    "sms"
  ]
}
"expiresOn": "2017-03-16T17:05:02Z"

Others...

These other properties may be of use:

PropertyTypeDescription
titlestringThe title to use to describe the message (if supported by the channel)
conversationIdstringOptional conversationId, used to correlate messages within the system and on any external channels, if supported
metadataobjectCustom metadata relating to the message that will be echoed back to you on any webhook events related to the message.

Can be used to correlate events back to sends, and aid webhook processing efficiency.

Ideal for use with webhooks for reporting and billing data collection.
channelOptionsobjectAllows easy configuration of popular options for a channel without the need for a full customBody. See each channels details for further details.
requireOptInbooleanIf requireOptIn is set to true, the message will be rejected if the target profile has not opted-in to any of the specified channels
{
  "body": "Hi, just letting you know that your order #1234 has been dispatched",
  "to": {
    "phoneNumber": "447123123123"
  },
  "rules": [
    "sms"
  ],
  "metadata": {
    "data": "My correlation data",
    "moreData": "You can hold any structured JSON data!"
  }
}