Apply For Templates with Sample Media

Use this API to create and submit a template along with sample media for your Gupshup App

You will need below details to start using this API.

  1. App Id
  2. Partner App Token
  3. Handle Id

Parameters

KeyDescriptionRequired/OptionalTypeValue
AuthorizationAccess Token for the applicationRequiredString{{PARTNER_APP_TOKEN}}
appIdUnique identifier for a Gupshup App RequiredString9e97650d-add3-4557-9535-4cdf47c3fa68
elementNameTemplate element nameOptionalStringticket_check_url_334
languageCodeTemplate language codeOptionalStringen_US
contentTemplate ContentOptionalStringYour verification code is {{1}}.
footerFooter of the template. Character limit: 60OptionalStringThis is the footer
categoryThe category of your template. Possible Values: AUTHENTICATION, MARKETING and UTILITY.
If you submit the templates with the any other categories, you will receive an error Invalid category provided, kindly use category from these option AUTHENTICATION, MARKETING, UTILITY.
OptionalStringMARKETING
templateTypeTemplate TypeOptionalStringIMAGE
verticalTemplate verticalOptionalStringTicket update
exampleTemplate ExampleOptionalStringYour verification code is 213.
exampleMedia4::aW1hZ2UvcadG5n:ARYaMMMA2QvIXuQZdPjWVXTOqfoBU3n0L1Ftyg4w57yxi9nD105yQDvW2nu3-HNo9HGefxZ-Ig-HAi3YSsckwIsOEUwxSPatsxT0Niob30E63A:e:1634884682:2281283925530161:100033655335566:ARaBAxW-1L-ZRu6SMSgThis is the handleId.
enableSampleRequired when submitting CTA template with variables.Booleantrue
allowTemplateCategoryChangeBoolean value. If True, Meta will automatically update the category of the template as per the template content. Default value is False. If the category gets updated, you can view the oldCategory from the Get Templates APIBooleanfalse

Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/templates' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'elementName={{ELEMENT_NAME}}' \
--data-urlencode 'languageCode={{LANGUAGE_CODE}}' \
--data-urlencode 'content=Your verification code is {{1}}.' \
--data-urlencode 'footer=This is the footer' \
--data-urlencode 'category={{CATEGORY}}' \
--data-urlencode 'templateType=IMAGE' \
--data-urlencode 'vertical=Ticket update' \
--data-urlencode 'appId={{APP_ID}}' \
--data-urlencode 'example=Your verification code is 213.' \
--data-urlencode 'exampleMedia={{HANDLE_ID}}' \
--data-urlencode 'enableSample=true' \
--data-urlencode 'allowTemplateCategoryChange=false'

Sample Response

 {
        "status": "success",
        "template": {
            "category": "TICKET_UPDATE",
            "createdOn": 1634624637136,
            "data": "Your verification code is {{1}}.",
            "elementName": "verification_code_with_image_3",
            "id": "ae*****e-7**c-4***-b0*11-6*****5b2***",
            "languageCode": "en",
            "languagePolicy": "deterministic",
            "master": true,
            "meta": "{\"example\":\"Your verification code is 123.\"}",
            "modifiedOn": 1634624637136,
            "status": "PENDING",
            "templateType": "IMAGE",
            "vertical": "TICKET_UPDATE",
            "allowTemplateCategoryChange": "false"
        }
 }
Language
Click Try It! to start a request and see the response here!