Additional options

Set expiry

For time sensitive messages you can specify an expiry date and time which we won't deliver your message after. Where a channel supports message expiry, the expiry time is passed on automatically.

To set an expiry, set the following property:

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

🚧

SMS expiry times

You must ensure that your expiry time is more than one minute from the current UTC time. If the time difference between UTC and the expiry time is less than a minute when processed then the default expiry is applied. One 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"

Other properties

Other properties which you might want to use:

PropertyTypeDescription
titlestringThe title to use to describe the message.

If supported by the channel.
conversationIdstringOptional conversation ID, used to correlate messages within the system and on any external channels, if supported.
metadataobjectCustom metadata relating to the message that is returned 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 channel’s documentation for further details.
requireOptInbooleanIf requireOptIn is set to true, the message is 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!"
  }
}