Messenger schema for business message templates used for business messaging
GET /v25.0/{messenger-business-template-id} 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(
'/{messenger-business-template-id}',
'{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(
"/{messenger-business-template-id}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{messenger-business-template-id}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{messenger-business-template-id}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| Field | Description |
|---|---|
idnumeric string | The ID for the business template |
categoryenum | The business template category |
componentslist<MessengerBusinessTemplateWhatsAppHSMComponentGet> | The components included in this template |
creation_timeinteger | Creation time of the template |
languagestring | The languages in which this template is available |
language_countinteger | The number of languages this template |
last_updated_timedatetime | The time at which this template was last updated |
library_template_namestring | The name of the template library that this template belongs |
namestring | The name of this template |
parameter_formatenum | parameter_format |
rejected_reasonenum | The reason this template was rejected |
rejection_reasonsMessengerBusinessTemplateWhatsAppBusinessHSMRejectionReasons | The reasons this template was rejected |
specific_rejection_reasonsMessengerBusinessTemplateWhatsAppBusinessHSMSpecificRejectionReasons | The specific reasons this template was rejected |
statusenum | The status of this template |
| Error | Description |
|---|---|
| 100 | Invalid parameter |
message_templates edge from the following paths: | Parameter | Description |
|---|---|
categoryenum {UTILITY} | Required. The category of the template. Required |
componentsarray<JSON object> | An array of objects to be included in the message. Can include the header, body, and buttons (phone number, postback, URL). |
languagestring | The language of the message. For example, en_US. Required |
library_template_button_inputsarray<JSON object> | An array of objects that define the type of button and it's contents and actions. |
library_template_namestring | The name of the library the template belongs to. |
namestring | The name of the template. Required |
id: numeric string, status: enum, category: enum, rejection_reason: enum, specific_rejection_reason: enum, | Error | Description |
|---|---|
| 200 | Permissions error |
| 100 | Invalid parameter |
/{messenger_business_template_id}.| Parameter | Description |
|---|---|
componentsarray<JSON object> | Update the components in this template |
success: bool, status: enum, rejection_reason: enum, specific_rejection_reason: enum, | Error | Description |
|---|---|
| 100 | Invalid parameter |
/{page_id}/message_templates.| Parameter | Description |
|---|---|
namestring | The name of the template to be deleted in all languages, if no template_id is provided. Required |
template_idnumeric string | Optional. Limits the deletion of template to the template_id provided. |
success: bool, | Error | Description |
|---|---|
| 200 | Permissions error |