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:
Property | Type | Description |
---|---|---|
expiresOn | date-time | Date/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:
Property | Type | Description |
---|---|---|
title | string | The title to use to describe the message. If supported by the channel. |
conversationId | string | Optional conversation ID, used to correlate messages within the system and on any external channels, if supported. |
metadata | object | Custom 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. |
channelOptions | object | Allows easy configuration of popular options for a channel without the need for a full customBody .See each channel’s documentation for further details. |
requireOptIn | boolean | If 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!"
}
}