Send msg With Template ID

Use this API to send messages with Template ID

Parameters

KeyDescriptionRequired/OptionalTypeValue
AuthorizationAccess Token for the applicationRequiredString{{PARTNER_APP_TOKEN}}
APP IDUnique Identifier for Gupshup AppRequiredString{{APP_ID}}
sourcePhone number to send a message from.

Required phone Number With Country Code
RequiredInteger91891056XXXX
src.nameApp nameStringRequiredAppname1
sandboxShould be boolean valueBooleanOptionalfalse
destinationPhone number of the customer to send the message to.

Required phone Number With Country Code.
RequiredInteger918286836XXX
templateMPM Template
For the MPM template, params must include all params including a product ID (which is to be used as a thumbnail (last in the list)).
For MPM template messages template section must be provided with valid Ids template={ "id":"3b9bf65b-979c-44d3-a269-dec2f20c4e52", "params":[ "zqc2qfz5fm" ], "mpm":{ "sections":\[{ "title":"Products", "products":[ "zqc2qfz5fm" ] }, { "title":"Products2", "products":[ "xyli96fcbn" ] }] } }

Catalog Template
The catalog template is only supported on CAPI.
For catalog template Params should contain the productId which will be sent as thumbnail for the catalog (Must be the last element in templateParams list).
OptionalString{"id": "007b7c0e-fc8d-4698-a9a8-3938151dd5da","params": ["monday","2020-12-20","apps"]}
src.nameApp name, whose appId used while creating templateRequiredStringGupshupDevAssistant01
messageRequired when templateType is 'LOCATION'.
Add video or image id/link for media LTO templates
OptionalString
channelMessaging channel to send message on.OptionalStringwhatsapp
TokenYour app token, please refer Get access token api to get the token from partner documentation.RequiredStringsk_61b3021c97xxx4370b341f8baaae0xxxx

Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/template/msg' \
--header 'Connection: keep-alive' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source={{SOUCR_PHONE_NUMBER}}' \
--data-urlencode 'sandbox=false' \
--data-urlencode 'destination={{DESTINATION_PHONE_NUMBER}}' \
--data-urlencode 'template={"id":"{{TEMPLATE_ID}}","params":["summer2023","summer2023","250FF"],"expiration":1703160863000}' \
--data-urlencode 'src.name={{SOURCE_APP_NAME}}'

Sample Response

    {
            "status": "submitted",
            "messageId": "b****acb-3***-4***-98**-64*****ea9**"
        }
             

Status Codes

Status CodeResponseComment
Success
200{ "status": "submitted", "messageId": <messageId> }
Error
400{ "message": "Invalid Destination", "status": "error" }If the destination is missing.
400{ "message": "Invalid App Details", "status": "error" }If the source is missing or app details are not found"If the source is unavailable or the application details cannot be found.
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
Language
Click Try It! to start a request and see the response here!