Send a text message with the Shout API

Easily send a text message from your Shout text or toll-free phone number

Shout makes it easy to send text messages from your Shout text (also known as customer service) and toll-free (aka marketing) phone numbers via a simple HTTP Post call. The Shout API will return a message ID and details about the message. Store the ID if you need to check or update the message later.

How Shout creates messages

Shout manages many types of messages and each type of message has its own unique requirements when it is created such as rate limits and whether it should deliver a push notification to a recipient using the Shout App. When Shout receives a request to create a message, it will automatically handle creation of the message, assigning it to the appropriate conversation, and delivering the message to third party providers such as telecom carriers. Each api call to create a Shout message immediately generates a message ID and then is assigned to a background queue to finish message creation and delivery.

Steps to send text messages

To send a text message using the Shout API, you can follow the steps below:

  1. Get an API key from Shout by signing up for an account here and creating an API key. You'll need this API key to authenticate your requests.
  2. Once you have your API key, you can send a text message by making a POST request to the Shout API endpoint with the following information:
  • outlet_typeThe texting outlet you want to use to send the text message. It can be either "text" or "toll-free". Make sure that the Shout account has a text or toll-free number registered and assigned to it.
  • profile_idThe id of the profile (aka contact) of the recipient.
  • body(Optional) The text messaage you want to send.
  • attachment_urls(Optional) A list of URLS of media files to include in the message (e.g. images, videos, files).

Make sure that each of the keys above are wrapped as a message object. Here's an example of how you could send a text message using the Shout API.

Language

Variant

Example Input

{
  "message": {
    "attachment_urls": [
      "https://example.com/image1.jpg"
    ],
    "body": "Hello, world!",
    "outlet_type": "text",
    "profile_id": "123456"
  }
}

Example Response

{
  "id": 1234,
  "body": "Hello, world!",
  "object": "message",
  "outlet_type": "text",
  "profile_id": "123456",
  "send_status": "will_send"
}

Make sure to customize the data dictionary with the specific details of your messageand replace YOUR_API_KEY_HERE with your actual API key. You may need to change the Authorization header to match your authentication type.

The Shout API will respond with a JSON object containing details about the message, including its ID and status.

Log In for examples with working credentials