Send a Message
Learn how create a request to the Mobile Text Alerts API that will send a message.
Last updated
Learn how create a request to the Mobile Text Alerts API that will send a message.
Last updated
Messages are sent via the API with POST
requests to the /send
endpoint. The request data must contain both recipient and content information.
Required Fields: (Must be one of the following from each)
Recipient(s):
subscriberIds: number[]
- List of subscriber IDs of recipients. Messages can be sent to specific subscribers, with each subscriber assigned a unique subscriberId
.
subscribers: (number | string)[]
- List of recipient phone numbers or email addresses. A new subscriber will be created for new recipients that are not already subscribers on your account.
allSubscribers: boolean
- Flag to indicate send message to all subscribers if true
. When allSubscribers
is set to true
, no other recipient fields should be specified. Default value is false
.
groups: number[]
- List of group IDs of recipients. Messages can be sent to specific groups, with each group assigned a unique groupId
.
threadId: number
- Messages can be sent in reply to a thread, with each thread assigned a unique threadId
.
Content:
message: string
- The content of the message being sent.
image: string
- The URL of an attachment for a message. By default, messages with attachments (image
) will be sent as an MMS. This URL needs to be publicly accessible; this ensures Mobile Text Alerts can access it when sending.
templateId: number
- Messages can be saved as pre-set for reuse with saved controlled templates on your account assigned a templateId
.
If using a templateId
of a template that requires a link, then a linkId
is also required.
Let's create a simple request to the /send
endpoint.
Create the API request to the /send
endpoint. Remember to include header.
to learn more about how to customize your message sends.
Used when a reference can be null