Templates are reusable messages that you can send to your customers, with a few variables that you can customize. These are useful for notifications, and can be sent directly from the Octopods Intercom Inbox app/widget.

Once the 24-hour customer service window has expired, Message Templates are the only way you'll be able to reestablish contact with your customer. Click here for more information on the customer service window.

Through Octopods, you can use our Message Templates API to programmatically send Message Templates to your Users directly.

Authentication

Once your WhatsApp Business API is approved and provisioned, we generate an API Key for your account to be used.

You can retrieve your API Key directly from our Octopods App by selecting your approved and provisioned WhatsApp Business API account.

You need to use your API Key by adding a header as the following:

X-Octopods-Auth: YOUR_API_KEY

API Endpoints

Retrieve Message Template(s)

HTTP GET https://app.octopods.io/api/v1/whatsapp/templates 

Request (in cURL)

curl --location --request GET 'https://app.octopods.io/api/v1/whatsapp/templates/' \
--header 'X-Octopods-Auth: YOUR_API_KEY' \
--header 'Content-Type: application/json'

Response (in JSON)

[
    {
        "created_at": "2020-03-10T11:29:14.000Z",
        "template_id": "019S7WT",
        "template_name": "reminder",
        "template_body": "Hello {{1}}, welcome {{2}}, Thank you.",
        "account_phone_number": "353892000000"

    },
    {
        "created_at": "2020-03-10T11:29:14.000Z",
        "template_id": "3303FTT",
        "template_name": "confirmation",
        "template_body": "Confirm {{1}}, again {{2}}, Thank you.",
        "account_phone_number": "353892000000"
    }
]



HTTP GET https://app.octopods.io/api/v1/whatsapp/templates/:TEMPLATE_ID

Request (in cURL)

curl --location --request GET 'https://app.octopods.io/api/v1/whatsapp/templates/019S7WT' \
--header 'X-Octopods-Auth: YOUR_API_KEY' \
--header 'Content-Type: application/json'

Response (in JSON)

{
    "created_at": "2020-03-10T11:29:14.000Z",
    "template_id": "019S7WT",
    "template_name": "reminder",
    "template_body": "Hello {{1}}, welcome {{2}}, Thank you.",
    "account_phone_number": "353892000000"

}

Send a Messsage Template


HTTP POST https://app.octopods.io/api/v1/whatsapp/templates/:TEMPLATE_ID/messages

Payload must be in JSON.

Request (in cURL)


curl --location --request POST 'https://app.octopods.io/api/v1/whatsapp/templates/019S7WT/messages' \
--header 'X-Octopods-Auth: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "destination_phone": "+353838000000",
    "message_variables": ["variable1", "variable2"]
}'


Response (Created 201)

201 Created

Errors

Example:

{

  "request_id": "d8c0d247-cfc9-48d7-868d-e6afdadb44dc",
  "error_code": 4,
  "error": "Your Message Template has 2 variables which you must supply."

}

Phone Number Format

Your phone number should be in the E164 format in order to avoid receiving an Invalid Phone number error.

Did this answer your question?