×

WhatsApp now allows uploading samples for templates with media headers : Document, Video, Image etc

To ensure templates submitted get approved seamlessly, uploading samples is a good practice.

Use this API to submit media sample files and generate media IDs.Media ID would then be used with create templates API to create and submit media templates for approval.

POST

https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/templates/sample

  • Replace <your_api_key> and <your_api_token> with the API key and token created by you.
  • Replace <your_sid> with your “Account sid”
  • Replace <subdomain> with the region of your account
    1. <subdomain> of Singapore cluster is @api.exotel.com
    2. <subdomain> of Mumbai cluster is @api.in.exotel.com

<your_api_key> , <your_api_token> and <your_sid> are available in the API settings page of your Exotel Dashboard

Listed below are the parameters for the POST API.

Parameter Name

Type

Mandatory/ Optional

Value/ Description

file_length

String

Mandatory

Size of the file in bytes

file_type

String

Mandatory

Type of the file (image/jpeg etc)

POST DATA

Binary data of the file

HTTPResponseObject

Parameter Name

Type

Mandatory/ Optional

Value/ Description

request_id

String

Mandatory

ID of the request

method

String

Mandatory

HTTP Request Method

http_code

Integer

Mandatory

HTTP Code of the request

response

ResponseObject

Mandatory

Response for the request

ResponseObject

Parameter Name

Type

Mandatory/ Optional

Values/ Description

whatsapp

ChannelResponseObject

Optional

Channel Response for Whatsapp

ChannelResponseObject

Parameter Name

Type

Mandatory/ Optional

Values/ Description

file_handle

[]FileHandleResponseObject

Mandatory

Message Response

FileHandleResponseObject

Parameter Name

Type

Mandatory/ Optional

Value/ Description

id

String

Mandatory

Id of the file_handle