Create a text template
Overview
Create a new text message template.
Use this to set up a campaign's text.
You'll need a name. The message isn't sent here: the template starts with a standard message (content in the response), which you change with Edit a text template.
Returns the template with its id.
Prerequisites
- A bearer token. See Authentication.
- Optional: a location id (
store_id) to tie the template to one location.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/campaign/template/sms/create
Authentication
Account token
- The template is saved under the account of the user behind the token.
store_id, when sent, must be a location inside your own account tree; otherwise422.
Rate limit
This endpoint has no rate limit.
Request parameters
None.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The template's name. Must be unique among your account's templates and the shared (global) templates. |
store_id | integer | No | A location to tie the template to. Must be inside your account tree. |
Request payload
{
"name": "Welcome SMS Template",
"store_id": 3007
}Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
message | string | SMS Template has been created successfully! |
data | object | The new template. |
data.id | integer | The template's id. Use it as sms_template_id. |
data.name | string | The template's name. |
data.content | string | The message text, with merge fields in square brackets such as [customerName], [landingPageUrl] and [locationName]. |
data.landing_page_id | integer or null | The landing page template linked to this text, or null. |
data.review_site_id | integer or null | The review site linked to this text, or null. |
data.store_id | integer or null | The location the template is tied to, or null. |
Response payload
{
"data": {
"status": "success",
"message": "SMS Template has been created successfully!",
"data": {
"id": 470,
"name": "Welcome SMS Template",
"content": "Hi [customerName], Your feedback means a lot to us. Please click here to share: [landingPageUrl]. Thank you from [locationName]. Stop 2 End.",
"landing_page_id": null,
"review_site_id": null,
"store_id": 3007
}
}
}Examples
Success payload
See Response payload.
Error payload
422 Duplicate name
{
"message": "The template name has already been taken.",
"errors": {
"name": [
"The template name has already been taken."
]
}
}422 Location outside your tree
{
"message": "The selected store id does not belong to your company hierarchy.",
"errors": {
"store_id": [
"The selected store id does not belong to your company hierarchy."
]
}
}422 Name missing
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}| Status | Meaning |
|---|---|
200 | The template was created. |
401 | The token is missing, expired or invalid. |
422 | name is missing or already taken, or store_id is outside your tree. |
500 | Unexpected server error. |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/campaign/template/sms/create" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"name": "Welcome SMS Template", "store_id": 3007}'Updated 17 days ago
Did this page help you?
