curl --request PUT \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/sms \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367",
"update_campaigns": false,
"basic_details": {
"message": "Hi {{UserAttribute['first_name']}}, your order has been delivered!"
},
"meta_info": {
"template_name": "Shipping Update Template V2",
"updated_by": "jane.doe@example.com",
"template_version": "2"
}
}
EOF{
"external_template_id": "eca024b7-a8ea-4f31-9154-5b80c85d18a9"
}{
"error": {
"code": "400 Bad Request",
"message": "Invalid template id",
"details": [
{
"code": "MissingValue",
"target": "9925c8",
"message": "9925c8 is invalid template id."
}
],
"request_id": "BTkUaYgU"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}Update SMS Template
This API updates an SMS template by specifying its external template ID. You can specify in the request whether the updated version of the template can be used in active campaigns.
curl --request PUT \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/sms \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367",
"update_campaigns": false,
"basic_details": {
"message": "Hi {{UserAttribute['first_name']}}, your order has been delivered!"
},
"meta_info": {
"template_name": "Shipping Update Template V2",
"updated_by": "jane.doe@example.com",
"template_version": "2"
}
}
EOF{
"external_template_id": "eca024b7-a8ea-4f31-9154-5b80c85d18a9"
}{
"error": {
"code": "400 Bad Request",
"message": "Invalid template id",
"details": [
{
"code": "MissingValue",
"target": "9925c8",
"message": "9925c8 is invalid template id."
}
],
"request_id": "BTkUaYgU"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}Rate Limit
The rate limit is 100 RPM.Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.
For more information on authentication and getting your credentials, refer here.
Body
The updated details for the SMS template.
This field contains the unique identifier that is generated by MoEngage during the template creation.
This field contains the basic details of the SMS template.
Show child attributes
Show child attributes
This field contains information about the template being created.
Show child attributes
Show child attributes
If true, this field contains a flag used to update all active campaigns currently using the template being updated to the newer version (being updated in this request).
Response
Template updated successfully.
The unique ID of the updated template.
Was this page helpful?