post https://partner.gupshup.io/partner/app//templates
Request Parameters
Key | Description | Value | Data Type | Required/Optional | Constraints |
---|---|---|---|---|---|
Authorization | Access Token for the application | {{PARTNER_APP_TOKEN}} | String | Required | Should be a valid Partner App Access Token |
elementName | The name of a template. The element name is unique for a WABAs namespace. | {{ELEMENT_NAME}} | String | Required | elementName (not more than 180 char.) Mandatory fields |
languageCode | Language code for the template. Refer to all the language codes here. | {{LANGUAGE_CODE}} | String | Optional | languageCode default value : en_US |
content | The body of the template. | {{CONTENT}} | String | Required | content (not more than 1024 char.) |
category | The category of your template. | {{CATEGORY}} | String | Required | Category Type: MARKETING UTILITY |
vertical | TEXT | {{VERTICAL}} | String | Required | vertical (not more than 180 char.) |
templateType | LOCATION | {{TEMPLATE_TYPE}} | String | Required | The type of template: LOCATION |
example | Template Example | {{EXAMPLE}} | String | Required | |
enableSample | Required for creating all types of templates | {{ENABLE_SAMPLE}} | true/false | Optional | if enableSample is true then exampleMedia |
footer | Footer of the template. Character limit: 60. | {{FOOTER}} | String | Optional | |
allowTemplateCategoryChange | Boolean value. If True, Meta will automatically update the template category as per the template content. The default value is False. | {{ALLOW_TEMPLATE_CATEGORY_CHANGE}} | true/false | Optional | |
APP ID | App ID to fetch the access token | {{APP_ID}} | String | Required | The Id should be a valid app Id of Gupshup The App must be associated with the account that owns the PARTNER_APP_TOKEN being used |
Sample Request
curl --location --request POST 'https://qa-partner-api.gupshup.io/partner/app/bf9ee64c-3d4d-4ac4-8668-732e577007c4/templates' \
--header 'token: sk_419da6a9b81e4377aea9a4f26951a38d' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'elementName=automation_template_908376' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'content=The place for the event is kothrud,Pune' \
--data-urlencode 'category=UTILITY' \
--data-urlencode 'appId=bf9ee64c-3d4d-4ac4-8668-732e577007c4' \
--data-urlencode 'vertical=Internal_vertical' \
--data-urlencode 'templateType=LOCATION' \
--data-urlencode 'example=The place for the event is kothrud,Pune' \
--data-urlencode 'allowTemplateCategoryChange=true' \
--data-urlencode 'checkerApprovalRequired=false' \
--data-urlencode 'enableSample=true' \
--data-urlencode 'footer=This is footer'
Sample Response
{
"status": "success",
"template": {
"appId": "bf9ee64c-3d4d-4ac4-8668-732e577007c4",
"category": "UTILITY",
"containerMeta": "{\"appId\":\"bf9ee64c-3d4d-4ac4-8668-732e577007c4\",\"data\":\"The place for the event is kothrud,Pune\",\"footer\":\"This is footer\",\"sampleText\":\"The place for the event is kothrud,Pune\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":true,\"addSecurityRecommendation\":false}",
"createdOn": 1710798305595,
"data": "The place for the event is kothrud,Pune\nThis is footer",
"elementName": "automation_template_908376",
"id": "b61ee9a9-ef22-48e0-bc65-30b01b6f9917",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": "{\"example\":\"The place for the event is kothrud,Pune\"}",
"modifiedOn": 1710798305595,
"namespace": "18cfa544_9c62_4dcd_b8f3_b3785d8c917c",
"priority": 2,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "LOCATION",
"vertical": "Internal_vertical",
"wabaId": "216141188246170"
}
}
Status Codes
Status Code | Response | Comment |
---|---|---|
Success | ||
200 | { "status":"success", "template":{ "appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797", "category":"UTILITY", "containerMeta":"{"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797","data":"The place for the event is kothrud,Pune","footer":"This is footer","sampleText":"The place for the event is kothrud,Pune","enableSample":true,"editTemplate":false,"allowTemplateCategoryChange":true,"addSecurityRecommendation":false}", "createdOn":1715598159948, "data":"The place for the event is kothrud,Pune\nThis is footer", "elementName":"template_automationkj", "id":"8ab1d9bc-aa7a-4f75-a977-bf79ff128ff0", "languageCode":"en", "languagePolicy":"deterministic", "meta":"{"example":"The place for the event is kothrud,Pune"}", "modifiedOn":1715598159948, "namespace":"9c7fe92f_2a48_40ec_83d0_69c62a772433", "priority":2, "quality":"UNKNOWN", "retry":0, "stage":"NONE", "status":"PENDING", "templateType":"LOCATION", "vertical":"Internal_vertical", "wabaId":"104505526065633" } } | |
Error | ||
429 | { "status": "error", "message": "Too Many Requests" } | 10 Requests per Minute |
500 | { "status": "error", "message": "Internal server error. Please try again later and If Issue still persist than contact Gupshup Dev Support" } | For any Internal Error |