⚙️
Channel360
HomeSign InSign Up
  • 🏠ChannelMobile Docs
  • Quick Start
    • Channel360 API
    • AgentChat API
    • Channel360 Guide
      • Dashboard
      • Templates
        • Template Creation
        • Template Configuration
      • Groups
        • Deleting Groups
        • Managing Group Details
      • Campaign
        • Campaign Creation
        • Campaign Statistics
      • Subscribers
        • Managing Subscribers
        • Subscriber Profile
  • Whatsapp Business API
    • WABA Prerequisites
    • WhatsApp Account Health
  • Our Products
    • Products
      • AgentChat
      • SMS
      • Broadcasting
      • ChatBot
  • API Usage
    • Using the Channel360 V1.1 API
      • Notifications
      • Templates
        • Create Templates
        • Read / Get Templates
        • Update Templates
        • Delete Templates
      • Webhooks
      • Conversations
        • Send Interactive Messages
        • Send Text Message
        • Send Media Message
          • Send Video Message
          • Send Image Message
          • Send File Message
        • Get Conversation History
  • Reference
    • API Reference
      • AgentChat API
      • Channel360 V1.1 API
  • FAQs
    • General FAQs
    • Channel360 FAQs
      • Templates
      • Notification Status
    • Technical FAQs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API Usage
  2. Using the Channel360 V1.1 API

Templates

What are templates and how to use them.

PreviousNotificationsNext Create Templates

Last updated 3 months ago

Was this helpful?

What are Templates?

Templates are pre-designed message formats that businesses use for automated communication with customers.


A template consists of...

1. Meta Data

1

name

The name of your template.

  • Requests must have a unique name / language pair

  • name can only contain lowercase, underscore characters, and numbers

2

description

Give your template a descripton (like what it's for).

3

language

The language the template is in, if the language of the template does not match the language chosen, META will reject the template.

Supported Languages:

4

category

Each template can be one of three categories, each having their own rules

  • MARKETING

  • UTILITY

  • AUTHENTICATION

5

status

When a template is created, it will be given a PENDING status and then META will either APPROVE or REJECT the template.

  • PENDING

  • APPROVED

  • REJECTED

Reasons for Rejection:

2. Components

A templates structure is determined by its components . The request can have up to four objects, either HEADER, BODY, FOOTER or BUTTONS.

AUTHENTICATION Templates have their own rules. See link below.

  • Optional

  • Maximum of 1 tag

  • Must have a format of either TEXT, DOCUMENT, IMAGE, VIDEO

  • Limited to 60 Characters

  • The image format will require an example image url from /api/templates/upload. The url must then again be used in campaign creation as a tag.

  • Required

  • Can have multiple tags

  • Limited to 1024 characters

  • Optional

  • Limited to 60 characters

  • Optional

  • Limited to 25 characters

  • Maximum of 1 tag

Headers don't need an example property, you simply add the parameter and off you go:

{
   "type":"HEADER",
   "format":"TEXT",
   "text":"Hello {{1}}",
   "example":{
      "header_text":[
         "Pete"
      ]
   }
}

Body requires an example:

{
   "type":"BODY",
   "text":"Is this your number {{1}}? We would love to give you a call!",
   "example":{
      "body_text":[
         [
            "0852345678"
         ]
      ]
   }
}

Button requires an example:

 {
     "type": "BUTTONS",
     "buttons": [
     {
                "type": "URL",
                "text": "View Dashboard",
                "url": "https://channel360.co.za/organization/{{1}}",
                "example": [
                    "639700347749ed00181de224"
                ]
        }
    ]
}

3. Tags

Tags are used in conjunction with the component parameters. They are essentially a means to add dynamic data into the HEADER, BODY and BUTTONS.

Tags can be created for the HEAD, BODY and BUTTONS content types

  • index should start at 1 and increment up

  • index of tag should match the order that you want to populate replacement tags for the HEAD / BODY / BUTTONS

Tag Structure

head: [
    {
        index: number;
        type: string;
        value?: string;
        url?: string;
        prompt?: string;
        fields?: string[]; //used for csv fields or subscriber fields depending on type
    }
];
body: [
    {
        index: number;
        type: string;
        value?: string;
        url?: string;
        prompt?: string;
        fields?: string[]; //used for csv fields or subscriber fields depending on type
    }
];

Tag Fields

Field
Description
Notes

index

Indexed used to populate replacement tags in template

Head and body

type

Type of Tag (see below)

The head tags cannot be populated with a csv

value

Used to store the value for 'hard-coded/on-campaign-creation' fields

url

Used to specify the url for tag types ( csv | image, video)

The following endpoint should be used to upload any files required by templates: {{url}}/v1.1/templates/upload This endpoint returns a list of the uploaded files along with their public url which must be specified

prompt

Used to populate the prompt when assigning a value to this tag on campaign creation

Used for csv/subscriber fields

fields

Array of fields to be used for tag replacement

Tag Types

Option
Description
Notes

csv

CSV Merge file uploaded to s3 and url saved against record

populate fields with the desired field + populate url with the key returned by {url}/v1.1/templates/upload

hard-coded

Hard Coded value (setup at on template creation)

populate value field with string value

on-campaign-creation

On Campaign Creation

populate the value with the text you would like to use when passing the tags object on campaign creation

image

Image uploaded to s3 and url saved against record

populate url field with the location returned by {url}/v1.1/templates/upload

video

Image uploaded to s3 and url saved against record

populate url field with the location returned by {url}/v1.1/templates/upload

subscriber-field

Subscriber field to use for tag replacement

populate fields with the subscriber field you want to replace - currently available fields are as follows: mobileNumber, firstName, lastName

Upload endpoint.

This endpoint facilitates the uploading of files for later use in templates.

Want to ingest a Template?

This endpoint updates your list of templates with META's list of your templates.


Want to get your Template approved?

The link below specifies all that needs to be known about getting your templates approved.

Get your template approved

WhatsApp has rules! We cannot just make any message we want and send them off to millions of people. It must meet the criteria. Only then can we send millions of messages.

META Documentation
META Documentation
Create Templates
https://www.channel360.co.za
  • What are Templates?
  • A template consists of...
  • 1. Meta Data
  • 2. Components
  • 3. Tags
  • Tag Structure
  • Tag Fields
  • Tag Types
  • Upload endpoint.
  • POSTUpload Template
  • Want to ingest a Template?
  • POSTIngest Template
  • Want to get your Template approved?
  • Get your template approved

Upload Template

post

API call to Upload a Template

Body
filestringOptionalExample: CompanyLogo.png
Responses
200
Successfully Uploaded Template
application/json
post
POST /v1.1/templates/upload HTTP/1.1
Host: www.channel360.co.za
Content-Type: multipart/form-data
Accept: */*
Content-Length: 26

{
  "file": "CompanyLogo.png"
}
200

Successfully Uploaded Template

{
  "uploadedFiles": {
    "fieldname": "file",
    "originalname": "CompanyLogo.png",
    "encoding": "7bit",
    "mimetype": "image/png",
    "size": 94234,
    "bucket": "channel360-template-tags",
    "key": "2022-11-14T14:31:35.967Z-CompanyLogo.png",
    "acl": "private",
    "contentType": "application/octet-stream",
    "contentDisposition": "null",
    "contentEncoding": "null",
    "storageClass": "STANDARD",
    "serverSideEncryption": "null",
    "metadata": {
      "fieldName": "file"
    },
    "location": "https://channel360-template-tags.channel360-template-tags.s3.af-south-1.amazonaws.com/2022-11-14T14%3A31%3A35.967Z-CompanyLogo.png",
    "etag": "\"14772585a3432789898f56f26870g97987\""
  }
}

Ingest Template

post

API call to ingest template

Path parameters
orgIdstringRequired
Body
filestringOptionalExample: test_file
Responses
200
Successfully ingested template
application/json
post
POST /v1.1/org/{orgId}/whatsapp/templates/ingest HTTP/1.1
Host: www.channel360.co.za
Content-Type: multipart/form-data
Accept: */*
Content-Length: 20

{
  "file": "test_file"
}
200

Successfully ingested template

{
  "messageTemplates": {
    "name": "test_file",
    "components": {
      "type": "HEADER",
      "format": "IMAGE",
      "example": []
    },
    "language": "en_US",
    "status": "APPROVED",
    "category": "MARKETING",
    "id": "2907957541046"
  }
}
Message Template Guidelines - WhatsApp Business Platform - Documentation - Facebook for DevelopersFacebook for Developers
Get started in
Logo