Messaging
Last updated
Was this helpful?
Last updated
Was this helpful?
In order to send a message you must have an active channel and perform an HTTP request to the following endpoint with a valid access key
When you send a message, a contact is automatically created with a contactId
matching the receiver's identifier if one doesn't already exist. For instance, sending an email generates a contact with an email identifier, while sending an SMS creates one with a phone number identifier.
When sending outbound messages as well as setting the receiver
information you must set the message body
field in all cases except for sending a message template when you must only set the template
field.
Multiple recipient messages are only possible through the Email platform. For other platforms, a message with multiple reciever
entries will be rejected.
When sending messages that contain media links these must be publicly accessible. Otherwise you can upload media by creating requesting a pre-signed media URL. Firstly make a POST request to the following endpoint with the content type of the media you will be uploading set in the request body.
There are two methods for generating a presigned URL: one is channel-independent, allowing it to be used across any channel, while the other restricts usage to a specified channel ID.
From the response you will get the following details:
mediaUrl: This will be the URL you set in any message bodies where you send the uploaded media
uploadUrl: This is the URL you will need to make a request to to upload your media file
uploadMethod: This is the HTTP method to make an upload i.e. POST
uploadFormData: Set this as the fields in form-data of your POST request along with an additional field called file. This should include your file data. An example using CURL
No need to specify any AccessKey on the below call as all the required data is provided in the form data.
Once you have uploaded the file using the mediaUrl, this should be used as the URL when sending messages with media.
For media that you have uploaded to be sent in a channels message you can retrieve this as follows
For media sent to your channel you can download this media from the following endpoint
Get media from a message
/workspaces/{workspaceId}/messages/{messageId}/media/{fileId}
No body
Send a message to a channel
/workspaces/{workspaceId}/channels/{channelId}/messages
The ID of the workspace
The ID for a channel
A reference to the message. This can be used to identify the message in the channel.
my-own-identifier
Tags to associate with the message. Tags are converted to lower case and tags that do not exist are automatically created. You can view your created tags in the UI. You can specify up to 10 tags per message.
SMS link shortening options. When using templates, please refer to
the template level shortLinks
instead.
Scheduled time to send message at. Must be formated as RFC3339 timestamp. When
set, the message status will be scheduled
until it's sent. Messages scheduled
for a time in the past or within 10 minutes of the request may be sent
immediately. Messages scheduled farther than 35 days will be rejected.
Validity determines for how many seconds a message is valid. If none is provided, the channel message type will be used to determine it. A promotional, conversational or transactional channel message is valid for 36 hours (129600 seconds). A message sent from a 2FA channel is valid for 10 minutes (600 seconds).
If set to true, the frequency capping settings of the platform will be used
to either allow or reject the message to a contact. Can only be set to true
if the message is sent to a contact and .meta.extraInformation.useCase
is marketing
.
If set to true and message is a test/campaign message, web tracking parameters will be appended to the links in the message.
If set to true, quiet hours settings will be ignored and the message will be sent as soon as possible.
Do not check if the recipient is part of global holdout. To be used to send transactional messages.
/workspaces/{workspaceId}/channel-media/presigned-upload
The ID of the workspace
/workspaces/{workspaceId}/channels/{channelId}/presigned-upload
The ID of the workspace
The ID for a channel
It retrieves a list of messages from a given channel ID
/workspaces/{workspaceId}/channels/{channelId}/messages
The ID of the workspace
The ID for a channel
Limits the number of results to return
Pagination token that keeps of track of the current position in the list
Order in which to retrieve the results
Filter based on platform name
incoming
, outgoing
Start date for the query
End date for the query
sender identifier for the message
recipient identifier for the message
Filter based on tag
Full text search on email subject
The ID for a batch
Get a channel message
/workspaces/{workspaceId}/channels/{channelId}/messages/{messageId}
The ID of the workspace
The ID for a message
The ID for a channel
List message interactions
/workspaces/{workspaceId}/channels/{channelId}/messages/{messageId}/interactions
The ID of the workspace
The ID for a message
The ID for a channel
It retrieves a list of messages from a given workspace ID
/workspaces/{workspaceId}/channels/messages
The ID of the workspace
Limits the number of results to return
The ID for a channel
Pagination token that keeps of track of the current position in the list
Order in which to retrieve the results
Filter based on platform name
incoming
, outgoing
Start date for the query
End date for the query
sender identifier for the message
recipient identifier for the message
Filter based on tag
Full text search on email subject