๐Ÿ“„ WhatsApp Template Listing API

Fetch approved WhatsApp message templates for a specific 2BeBot Channel. These templates can be used when sending template-based messages via the 2BeBot Integration.


๐Ÿ”— Endpoint

GET /api/v1/whatsapp/:id/templates
  • :id = ID of the 2BeBot Channel

๐Ÿ” Authentication

All requests must include a valid API key passed as a Bearer token in the Authorization header:

You can get your API key from the /companies page.

Authorization: Bearer YOUR_API_KEY

๐Ÿ“ฅ Request

๐Ÿ”ธ Path Parameters

ParameterTypeRequiredDescription
idstringโœ… Yes2BeBot Channel ID for which to fetch templates

๐Ÿ“ค Response

Returns a list of approved templates registered under the given 2BeBot Channel.

โœ… Success (200)

Example Response

[
  {
    "id": "2",
    "name": "with_header",
    "language": "en_US",
    "category": "MARKETING",
    "body_text": [
      {
        "value": "Dennis",
        "variable": "{{1}}"
      }
    ],
    "header_text": {
      "value": "https://smart.smartfiles.download/meta_templates/99c6cd2b_6d6e_43c3_b78b_2810d27bf78c_512_x_512_px_.png",
      "variable": "{{url}}"
    },
    "header_type": "MEDIA"
  }
]

๐Ÿ”Ž Field Reference

FieldTypeDescription
idstringTemplate ID (internal database ID)
namestringName of the template (used when sending messages)
languagestringLanguage code in en_US, fr, etc.
categorystringTemplate category, e.g. MARKETING, UTILITY, AUTHENTICATION
body_textarrayArray of variables used in the message body, includes placeholder variable and a sample value
header_typestringEither "TEXT" or "MEDIA"
header_textobjectHeader content placeholder. If MEDIA, contains a placeholder media URL and variable name ({{url}})

๐Ÿ” Notes on Usage

  • body_text.value and header_text.value are examples or placeholders.
  • These values must be replaced with actual dynamic content in your message payload when sending the message.
  • The variable field (e.g. {{1}}, {{url}}) matches the placeholders configured in your template on Meta's WhatsApp Manager.

โŒ Not Found (404)

{
  "error": "No templates found"
}

Returned if no approved templates exist for the given 2BeBot Channel ID.


๐Ÿงช Example Request

curl -X GET https://smart.botatende.com/api/v1/whatsapp/123/templates \
  -H "Authorization: Bearer YOUR_API_KEY"