This page contains only the API reference. For more information on how to use the API, refer to the WhatsApp Business Management API documentation.
Retrieves information about the message template
GET v9.0/...?fields={fieldname_of_type_WhatsAppMessageTemplate} 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(
'...?fields={fieldname_of_type_WhatsAppMessageTemplate}',
'{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(
"...?fields={fieldname_of_type_WhatsAppMessageTemplate}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"...?fields={fieldname_of_type_WhatsAppMessageTemplate}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"...?fields={fieldname_of_type_WhatsAppMessageTemplate}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Field | Description |
---|---|
id numeric string | ID |
category enum | The category type of the message template |
components list<WhatsAppBusinessHSMWhatsAppHSMComponentGet> | The array containing all the content of the message template |
language string | The language (and locale) of the element translation |
last_updated_time datetime | The timestamp indicating the last time the message template was updated |
name string | The message template name |
quality_score | Quality score of the HSM |
rejected_reason enum | The reason the message template was rejected |
status enum | The status of the message template |
Error | Description |
---|---|
100 | Invalid parameter |
message_templates
edge from the following paths: Parameter | Description |
---|---|
category enum {ACCOUNT_UPDATE, PAYMENT_UPDATE, PERSONAL_FINANCE_UPDATE, SHIPPING_UPDATE, RESERVATION_UPDATE, ISSUE_RESOLUTION, APPOINTMENT_UPDATE, TRANSPORTATION_UPDATE, TICKET_UPDATE, ALERT_UPDATE, AUTO_REPLY} | Message template category Required |
array<JSON object> | This is the new format for entering the content for the message template |
language string | The language (and locale) of the content Required |
name string | Name of the message template Required |
id
: numeric string, Error | Description |
---|---|
100 | Invalid parameter |
200 | Permissions error |
192 | Invalid phone number |
/{whats_app_business_account_id}/message_templates
.Parameter | Description |
---|---|
name string | Message Template Name Required |
success
: bool, Error | Description |
---|---|
100 | Invalid parameter |