curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/2/senders/{sender}/templates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "text_template",
"language": "en",
"category": "MARKETING",
"structure": {
"body": {
"text": "body {{1}} content",
"examples": [
"example"
]
}
}
}
'{
"id": "111",
"businessAccountId": 222,
"name": "media_template",
"language": "en",
"status": "APPROVED",
"category": "MARKETING",
"structure": {
"header": {
"format": "IMAGE"
},
"body": {
"text": "example {{1}} body"
},
"footer": {
"text": "exampleFooter"
},
"type": "MEDIA"
},
"quality": "HIGH",
"platform": {
"entityId": "entityId",
"applicationId": "applicationId"
},
"createdAt": "2024-01-01T00:00:00.000+0000",
"lastUpdatedAt": "2024-01-01T00:00:00.000+0000"
}Create WhatsApp Template
Create a WhatsApp template. Once created, Phonovation submits a template for WhatsApp’s review and approval. When approved, a template can be sent to end users. Refer to template guidelines for additional info.
Required scope: Enable one of: whatsapp:manage.
curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/2/senders/{sender}/templates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "text_template",
"language": "en",
"category": "MARKETING",
"structure": {
"body": {
"text": "body {{1}} content",
"examples": [
"example"
]
}
}
}
'{
"id": "111",
"businessAccountId": 222,
"name": "media_template",
"language": "en",
"status": "APPROVED",
"category": "MARKETING",
"structure": {
"header": {
"format": "IMAGE"
},
"body": {
"text": "example {{1}} body"
},
"footer": {
"text": "exampleFooter"
},
"type": "MEDIA"
},
"quality": "HIGH",
"platform": {
"entityId": "entityId",
"applicationId": "applicationId"
},
"createdAt": "2024-01-01T00:00:00.000+0000",
"lastUpdatedAt": "2024-01-01T00:00:00.000+0000"
}Authorizations
This is the most secure authorization type and the one with the most flexibility.
API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.
You can manage your API keys from GUI, or programmatically with dedicated API.
API key Authorization header example:
Authorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9
Path Parameters
Registered WhatsApp sender number. Must be in international format.
Body
- DefaultMarketingTemplatePublicApiRequest
- DefaultTemplatePublicApiRequest
- AuthenticationTemplatePublicApiRequest
Template name. Must only contain lowercase alphanumeric characters and underscores.
1^[a-z0-9_]{1,512}$Structure of the created template. Can consist of body (mandatory), header, footer, buttons, carousel, limited time offer, call permission request and shortening options.
Show child attributes
Show child attributes
Template language, one template with same name can have multiple transliterations.
af, sq, ar, ar_EG, ar_AE, ar_LB, ar_MA, ar_QA, az, bn, bn_IN, bg, ca, zh_CN, zh_HK, zh_TW, hr, cs, da, nl, nl_BE, en, en_GB, en_US, en_AE, en_AU, en_CA, en_GH, en_IE, en_IN, en_JM, en_MY, en_NZ, en_QA, en_SG, en_UG, en_ZA, et, fil, fi, fr, fr_BE, fr_CA, fr_CH, fr_CI, fr_MA, ka, de, de_AT, de_CH, el, gu, ha, he, hi, hu, id, ga, it, ja, kn, kk, rw_RW, ko, ky_KG, lo, lv, lt, mk, ms, ml, mr, nb, fa, pl, pt_BR, pt_PT, pa, ro, ru, sr, si_LK, sk, sl, es, es_AR, es_CL, es_CO, es_CR, es_DO, es_EC, es_HN, es_MX, es_PA, es_PE, es_ES, es_UY, sw, sv, ta, te, th, tr, uk, ur, uz, vi, zu, unknown "en"
Category of the template. Mind that each category has different fields available for the endpoint. If you're sending traffic in India, for AUTHENTICATION, use fields available for UTILITY with AUTHENTICATION as category. Note that category of the template can be automatically changed by Meta.
MARKETING, AUTHENTICATION, UTILITY 1"MARKETING"
Template validity period in which WhatsApp will try to deliver a template message. Supported ranges are dependent on template category: 10 seconds to 15 minutes for Authentication, 30 seconds to 12 hours for Utility, and 12 to 48 hours for Marketing. Marketing validity periods apply only to messages sent through the Marketing Messages API and are ignored by the Cloud API.
Show child attributes
Show child attributes
Platform options. For more details, see documentation.
Show child attributes
Show child attributes
Response
Template created.
- DefaultMarketingTemplateApiResponse
- DefaultTemplateApiResponse
- AuthenticationTemplateApiResponse
The list of the results for this page.
Structure of the created template. Can consist of body (mandatory), header, footer, buttons, carousel, limited time offer, call permission request and shortening options.
Show child attributes
Show child attributes
Template ID.
"111"
Business account ID to which template belongs.
222
Name of the template.
"template_name"
Template language, one template with same name can have multiple transliterations.
af, sq, ar, ar_EG, ar_AE, ar_LB, ar_MA, ar_QA, az, bn, bn_IN, bg, ca, zh_CN, zh_HK, zh_TW, hr, cs, da, nl, nl_BE, en, en_GB, en_US, en_AE, en_AU, en_CA, en_GH, en_IE, en_IN, en_JM, en_MY, en_NZ, en_QA, en_SG, en_UG, en_ZA, et, fil, fi, fr, fr_BE, fr_CA, fr_CH, fr_CI, fr_MA, ka, de, de_AT, de_CH, el, gu, ha, he, hi, hu, id, ga, it, ja, kn, kk, rw_RW, ko, ky_KG, lo, lv, lt, mk, ms, ml, mr, nb, fa, pl, pt_BR, pt_PT, pa, ro, ru, sr, si_LK, sk, sl, es, es_AR, es_CL, es_CO, es_CR, es_DO, es_EC, es_HN, es_MX, es_PA, es_PE, es_ES, es_UY, sw, sv, ta, te, th, tr, uk, ur, uz, vi, zu, unknown "en"
Status of the template.
APPROVED, IN_APPEAL, PENDING, REJECTED, PENDING_DELETION, DELETED, REINSTATED, FLAGGED, FIRST_PAUSED, SECOND_PAUSED, DISABLED, ARCHIVED, UNKNOWN "APPROVED"
Category of the template.
MARKETING, AUTHENTICATION, UTILITY "MARKETING"
Quality of the template.
HIGH, MEDIUM, LOW, UNKNOWN "HIGH"
Template validity period in which WhatsApp will try to deliver a template message. Supported ranges are dependent on template category: 10 seconds to 15 minutes for Authentication, 30 seconds to 12 hours for Utility, and 12 to 48 hours for Marketing. Marketing validity periods apply only to messages sent through the Marketing Messages API and are ignored by the Cloud API.
Show child attributes
Show child attributes
Platform options. For more details, see documentation.
Show child attributes
Show child attributes
Creation date of the template.
Last update date of the template.
Name of the library template from which this template was created. If not present, the template was not created using the template library.