get https://partner.gupshup.io/partner/app//template/analytics//compare
Use this API to compare templates
Request Parameters
Key | Description | Constraints |
---|---|---|
PARTNER_TOKEN | JWT Token issues post Partner login | Should be a valid Partner JWT Token. |
appId | AppId of the app for which embed link needs to generate. | Should be a valid appId associated with the account. |
gsTemplateId Id | ID of the WhatsApp Message Template to target. | Should be a valid template ID |
template_ids | Array of template Ids to compare. | The array should contain exactly one valid template id. |
start_timestamp | Start time | start and end time both are in milli second in long form |
end_timestamp | End time |
Sample Request
curl --location '{{partner_portal_base_url}}/partner/app/{{appId}}/template/analytics/{{gsTemplateId}}/compare?templateList={{template_list}}&end={{end_timestamp}}start={{start_timestamp}}' \
--header 'token: {{PARTNER_TOKEN}}'
Sample Response
{
"data": [
{
"metric": "BLOCK_RATE",
"order_by_relative_metric": [ {{list_of_gs_templateId}} ],
"type": "RELATIVE"
},
{
"metric": "MESSAGE_SENDS",
"number_values": [
{
"key": "{{gs_template_id_1}}",
"value": {{Number_of_messages_sent}}
},
{
"key": "{{gs_template_id_2}}",
"value": {{Number_of_messages_sent}}
}
],
"type": "NUMBER_VALUES"
},
{
"metric": "TOP_BLOCK_REASON",
"string_values": [
{
"key": "{{gs_template_id}}",
"value": "{{block_reason}}"
},
{
"key": "{{gs_template_id}}",
"value": "{{block_reason}}"
}
],
"type": "STRING_VALUES"
}
],
"status": "success"
}
Status Code
Status Code | Response | Comment |
---|---|---|
Success | ||
200 | { "data": \[ { "metric": "BLOCK_RATE", "order_by_relative_metric": [ {{list_of_gs_templateId}} ], "type": "RELATIVE" }, { "metric": "MESSAGE_SENDS", "number_values": [ { "key": "{{gs_template_id_1}}", "value": {{Number_of_messages_sent}} }, { "key": "{{gs_template_id_2}}", "value": {{Number_of_messages_sent}} } ], "type": "NUMBER_VALUES" }, { "metric": "TOP_BLOCK_REASON", "string_values": [ { "key": "{{gs_template_id}}", "value": "{{block_reason}}" }, { "key": "{{gs_template_id}}", "value": "{{block_reason}}" } ], "type": "STRING_VALUES" } ], "status": "success" } | The speed_processed may not be the same as the one sent in the request as it depends on the payment gateway |
Error | ||
400 | { "status": "error", "message": "Authentication Failed" } | |
400 | { "message": "The difference between start and end times should be the number of seconds in 7, 30, 60 or 90 days.", "status": "error" } | |
400 | { "message": "One or more templates in the list is not approved.", "status": "error" } | |
400 | { "message": "The parameter start_timestamp should be less than end_timestamp.", "status": "error" } | |
400 | { "message": "Not Template Owner", "status": "error" } | |
429 | { "status": "error", "message": "Too Many Requests" } | When request rate limit exceeds. |