Compare template send counts and block ratios. See Template Comparison.
Compare the WhatsApp message template's send count and block ratio to another WhatsApp message template's send count and block ratio.
Type | Description |
---|---|
User or System User | |
GET /<WHATSAPP_MESSAGE_TEMPLATE_ID>/compare ?template_ids=[<TEMPLATE_IDS] &start=<START> &end=<END>
{ "data": [ { "metric": "BLOCK_RATE", "type": "RELATIVE", "order_by_relative_metric": [<ORDER_BY_RELATIVE_METRIC>] }, { "metric": "MESSAGE_SENDS", "type": "NUMBER_VALUES", "number_values": [<NUMBER_VALUES>] }, { "metric": "TOP_BLOCK_REASON", "type": "STRING_VALUES", "string_values": [<STRING_VALUES>] } ] }
curl -X GET 'https://graph.facebook.com/v18.0
/5289179717853347/compare?template_ids=[1533406637136032]&start=1674844791182&end=1674845395982' \
-H 'Authorization: Bearer EAAJB...'
{ "data": [ { "metric": "BLOCK_RATE", "type": "RELATIVE", "order_by_relative_metric": [ "1533406637136032", "5289179717853347" ] }, { "metric": "MESSAGE_SENDS", "type": "NUMBER_VALUES", "number_values": [ { "key": "5289179717853347", "value": 1273 }, { "key": "1533406637136032", "value": 1042 } ] }, { "metric": "TOP_BLOCK_REASON", "type": "STRING_VALUES", "string_values": [ { "key": "5289179717853347", "value": "UNKNOWN_BLOCK_REASON" }, { "key": "1533406637136032", "value": "UNKNOWN_BLOCK_REASON" } ] } ] }
GET /v18.0/{whats-app-message-template-id}/compare HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{whats-app-message-template-id}/compare',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{whats-app-message-template-id}/compare",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{whats-app-message-template-id}/compare",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{whats-app-message-template-id}/compare"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Parameter | Description |
---|---|
end datetime/timestamp | UNIX timestamp indicating end of timeframe. Timeframes are limited to 7, 30, 60 and 90 day lookbacks from the time of the request. To define a timeframe, set your end date to the current time as a UNIX timestamp, then subtract the number of days for your desired timeframe, in seconds, from that value: Required |
start datetime/timestamp | UNIX timestamp indicating start of timeframe. Timeframes are limited to 7, 30, 60 and 90 day lookbacks from the time of the request. To define a timeframe, set your end date to the current time as a UNIX timestamp, then subtract the number of days for your desired timeframe, in seconds, from that value: Required |
template_ids array<EntWhatsAppBusinessHSM ID> | ID of the WhatsApp Message Template to compare the target to. Required |
Reading from this edge will return a JSON formatted result:
{ "
data
": [], "paging
": {} }
data
paging
Error | Description |
---|---|
100 | Invalid parameter |