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

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://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; otherwise 422.

Rate limit

This endpoint has no rate limit.

Request parameters

None.

Request body

FieldTypeRequiredDescription
namestringYesThe template's name. Must be unique among your account's templates and the shared (global) templates.
store_idintegerNoA 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.

FieldTypeDescription
statusstringsuccess.
messagestringSMS Template has been created successfully!
dataobjectThe new template.
data.idintegerThe template's id. Use it as sms_template_id.
data.namestringThe template's name.
data.contentstringThe message text, with merge fields in square brackets such as [customerName], [landingPageUrl] and [locationName].
data.landing_page_idinteger or nullThe landing page template linked to this text, or null.
data.review_site_idinteger or nullThe review site linked to this text, or null.
data.store_idinteger or nullThe 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."
    ]
  }
}
StatusMeaning
200The template was created.
401The token is missing, expired or invalid.
422name is missing or already taken, or store_id is outside your tree.
500Unexpected 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}'

Did this page help you?