Send message(s) to a subscriber
Trigger SMS/MMS messages. Maximum 10 messages can be sent in a single request. Requester must comply with TCPA regulations, and make sure the message is not sent in quiet hours.
The site must have an active or trial SMS subscription, otherwise the request fails with 417.
Messages are queued in the order given rather than sent inline, so 202 confirms that they were accepted for delivery, not that they were delivered. The response returns one entry per message; poll GET /messages/{id} with the returned IDs to follow their delivery status.
It can be obtained in Recart account after contacting Support
The messages were accepted and queued for delivery, one entry per message, in the order they were given.
ERR_BAD_REQUEST — the payload failed validation, in which case detail lists
the offending fields, or phoneNumber could not be parsed as a phone number.
Validation covers the documented limits: at most 10 messages, body at most
1024 characters, type must be promotional, and attachment must end in
.jpg, .jpeg, .png, or .gif.
ERR_UNAUTHORIZED — the X-Recart-API-Key header is missing.
ERR_FORBIDDEN — the API key is unknown or has been revoked.
ERR_UNSUPPORTED_MEDIA_TYPE — Content-Type must be application/vnd.api+json
or application/json.
ERR_EXPECTATION_FAILED — the site does not have an active or trial SMS
subscription, so no messages can be sent until billing is resolved. No message
in the request was queued.
The request passed validation but could not be processed.
Messages are queued one by one, so a failure partway through leaves the earlier messages of the request already queued for delivery. No message IDs are returned in this case, so a blind retry of the whole request can duplicate the messages that already went through.
Unlike the 4XX responses, this status is not guaranteed to use the standard
error envelope — an unstructured plain-text body is possible — so do not match
on errors[].code here.
HTTP Error response
HTTP Error response
POST /app-integrations/2023-12/messages HTTP/1.1
Host: api.recart.com
X-Recart-API-Key: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 178
{
"data": {
"type": "messages",
"attributes": {
"phoneNumber": "+36301234567",
"messages": [
{
"type": "promotional",
"body": "Hi, welcome to our store.",
"attachment": "https://img.url.jpg"
}
]
}
}
}{
"data": [
{
"type": "messages",
"attributes": {
"id": "65ba227ffa0ad3e1bef89449",
"message": "Hi, welcome to our store."
}
}
]
}Last updated
Was this helpful?