Text Messages
Use this endpoint to manipulate and obtain details on Salesbox’s Text Messages.
Base Endpoint
https://segmentai.salesbox.com.br/api/text-messages
Get Text Message
GET /api/text-messages/{id}
Get an individual Text Message by ID.
HTTP Request
GET /api/text-messages/ID
Response
Expected Response Code: 200
{
"textMessage": {
"id": 1,
"content": "Your appointment is confirmed for tomorrow at 2 PM",
"recipient": "+1234567890",
"status": "sent",
"sentAt": "2024-01-15T10:00:00+00:00",
"deliveredAt": "2024-01-15T10:00:05+00:00",
"createdAt": "2024-01-15T09:55:00+00:00",
"modifiedAt": "2024-01-15T10:00:05+00:00",
"createdBy": 1,
"createdByUser": "John Smith",
"modifiedBy": 1,
"modifiedByUser": "John Smith",
"campaign": {
"id": 5,
"name": "Appointment Reminders"
}
}
}
Text Message Properties
Name |
Type |
Description |
|---|---|---|
|
int |
ID of the Text Message |
|
string |
Content of the message |
|
string |
Phone number of the recipient |
|
string |
Status of the message (draft, queued, sent, delivered, failed) |
|
datetime/null |
When the message was sent |
|
datetime/null |
When the message was delivered |
|
datetime |
Message creation date/time |
|
datetime/null |
Message last modified date/time |
|
int |
ID of the User that created the message |
|
string |
Name of the User that created the message |
|
int |
ID of the User that last modified the message |
|
string |
Name of the User that last modified the message |
|
object/null |
Associated campaign details |
List Text Messages
GET /api/text-messages
Get a list of text messages.
Query Parameters
Name |
Type |
Description |
|---|---|---|
|
string |
Text to search messages by |
|
int |
Which page to display |
|
int |
How many records to return |
|
string |
Column to sort by |
|
string |
Sort direction: asc or desc |
|
string |
Filter by message status |
|
int |
Filter by campaign ID |
Create Text Message
POST /api/text-messages/new
Create a new text message.
Request Body
Name |
Type |
Description |
|---|---|---|
|
string |
Message content |
|
string |
Recipient phone number |
|
int |
Associated campaign ID (optional) |
|
datetime |
When to send the message (optional) |
Edit Text Message
PATCH /api/text-messages/{id}/edit
Edit an existing text message.
Request Body
Same fields as Create Text Message.
Delete Text Message
DELETE /api/text-messages/{id}/delete
Delete an existing text message.
Send Text Message
POST /api/text-messages/{id}/send
Send a text message immediately.