•  


그래프 API 參照 v20.0: Whats App Business Account Message Templates - 文書 - Meta for Developers
그래프 API 버전

Whats App Business Account Message Templates

Represents a collection of templates on a WhatsApp Business Account . See Templates .

읽기

Get a list of templates on a WhatsApp Business Account.

Requirements

Type Description

Access Tokens

User or System User

Permissions

whatsapp_business_management

Request Syntax

GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates
  ?category=<CATEGORY>,
  &content=<CONTENT>,
  &language=<LANGUAGE>,
  &name=<NAME>,
  &name_or_content=<NAME_OR_CONTENT>,
  &quality_score=<QUALITY_SCORE>,
  &status=<STATUS>

Path Parameters

Placeholder Value

<WHATSAPP_BUSINESS_ACCOUNT_ID>

WhatsApp Business Account ID.

Response

A list of WhatsApp Message Template nodes.

Sample Request

curl 'https://graph.facebook.com/v16.0/102290129340398/message_templates?category=utility' \
-H 'Authorization: Bearer EAAJB...'

Sample Response

{
  "data": [
    {
      "name": "order_delivery_update",
      "components": [
        {
          "type": "HEADER",
          "format": "LOCATION"
        },
        {
          "type": "BODY",
          "text": "Good news {{1}}! Your order #{{2}} is on its way to the location above. Thank you for your order!",
          "example": {
            "body_text": [
              [
                "Mark",
                "566701"
              ]
            ]
          }
        },
        {
          "type": "FOOTER",
          "text": "To stop receiving delivery updates, tap the button below."
        },
        {
          "type": "BUTTONS",
          "buttons": [
            {
              "type": "QUICK_REPLY",
              "text": "Stop Delivery Updates"
            }
          ]
        }
      ],
      "language": "en_US",
      "status": "APPROVED",
      "category": "UTILITY",
      "id": "1667192013751005"
    },
    ...
  ],
  "paging": {
    "cursors": {
      "before": "MAZDZD",
      "after": "MjQZD"
    }
  }
}

媒介變數

媒介變數 說明
category
array<enum {ACCOUNT_UPDATE, PAYMENT_UPDATE, PERSONAL_FINANCE_UPDATE, SHIPPING_UPDATE, RESERVATION_UPDATE, ISSUE_RESOLUTION, APPOINTMENT_UPDATE, TRANSPORTATION_UPDATE, TICKET_UPDATE, ALERT_UPDATE, AUTO_REPLY, TRANSACTIONAL, OTP, UTILITY, MARKETING, AUTHENTICATION}>

The category for a template

content
string

The content for a template

language
array<string>

A list of supported languages that are available for each template

name
string

The name for a message template

name_or_content
string

Returns a list of message templates where the value for name or content match this value

quality_score
array<enum {GREEN, YELLOW, RED, UNKNOWN}>

The quality score for a template

status
array<enum {APPROVED, IN_APPEAL, PENDING, REJECTED, PENDING_DELETION, DELETED, DISABLED, PAUSED, LIMIT_EXCEEDED, ARCHIVED}>

The review status for a template

필드

이 에지로부터 읽는 境遇 JSON 形式의 結果를 返還합니다:

{ " data ": [], " paging ": {}, " summary ": {} }

data

WhatsAppMessageTemplate 노드 리스트.

paging

페이지 매김에 對한 仔細한 情報는 그래프 API 가이드 를 確認하세요.

summary

數値 等 에지에 關해 集計된 情報입니다. 要約 媒介變數에 가져오려면 該當 필드를 指定하세요(예: summary=total_count ).

필드 說明
total_count
unsigned int32

The total number of message templates that belong to a WhatsApp Business Account

message_template_count
int32

The current number of message templates that belong to the WhatsApp Business Account

message_template_limit
int32

The maximum number of message templates that can belong to a WhatsApp Business Account

are_translations_complete
bool

The status for template translations

誤謬 코드

誤謬 說明
200 Permissions error
80008 There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
100 Invalid parameter
190 Invalid OAuth 2.0 Access Token
368 The action attempted has been deemed abusive or is otherwise disallowed
2500 Error parsing graph query

만들기

다음 經路에서 message_templates 에지에 POST 要請을 만들 수 있습니다:
이 에지에 揭示할 때 a? WhatsAppMessageTemplate 이(가) 生成됩니다.
Type Description

Access Tokens

User or System User

Permissions

whatsapp_business_management

Request Syntax

POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates

Path Parameters

Placeholder Value

<WHATSAPP_BUSINESS_ACCOUNT_ID>

ID of the WhatsApp Business Account to create the template on.

Post Body

See Parameters for property descriptions.

{
  "allow_category_change": <ALLOW_CATEGORY_CHANGE>,
  "name": "<NAME>",
  "language": "<LANGUAGE>",
  "category": "<CATEGORY>",
  "components": [<COMPONENTS>]
}

Response

See Return Type .

Sample Request

curl 'https://graph.facebook.com/
v20.0
/102290129340398/message_templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "name": "seasonal_promotion",
  "language": "en",
  "category": "MARKETING",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Our {{1}} is on!",
      "example": {
        "header_text": [
          "Summer Sale"
        ]
      }
    },
    {
      "type": "BODY",
      "text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
      "example": {
        "body_text": [
          [
            "the end of August","25OFF","25%"
          ]
        ]
      }
    },
    {
      "type": "FOOTER",
      "text": "Use the buttons below to manage your marketing subscriptions"
    },
    {
      "type":"BUTTONS",
      "buttons": [
        {
          "type": "QUICK_REPLY",
          "text": "Unsubcribe from Promos"
        },
        {
          "type":"QUICK_REPLY",
          "text": "Unsubscribe from All"
        }
      ]
    }
  ]
}'

Sample Response

{
    "id": "594425479261596",
    "status": "PENDING",
    "category": "MARKETING"
}

媒介變數

媒介變數 說明
allow_category_change
boolean

Set to true to allow us to assign a category based on our template guidelines and the template's contents. This can prevent the template status from immediately being set to REJECTED upon creation due to miscategorization.


If omitted, template will not be auto-assigned a category and its status may be set to REJECTED if determined to be miscategorized.


See Template Categories .

category
enum {UTILITY, MARKETING, AUTHENTICATION}

Template category. See Template Categories .

必須
components
array<JSON object>

Array of components that make up the template. See Template Components .


For types HEADER , BODY , FOOTER , text is required.

type
enum {GREETING, HEADER, BODY, FOOTER, BUTTONS, CAROUSEL, LIMITED_TIME_OFFER}

Component type.

必須
format
enum {TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION}

Component format.

text
string

Required for components with type HEADER , BODY , or FOOTER .


Component text.

buttons
array<JSON object>

Button components to be used in the template.

type
enum {QUICK_REPLY, URL, PHONE_NUMBER, OTP, MPM, CATALOG, FLOW, VOICE_CALL}

Button type.

必須
text
string

Button text.

url
URI

url

phone_number
phone number string

phone_number

example
array<string>

example

flow_id
int64

flow_id

zero_tap_terms_accepted
boolean

zero_tap_terms_accepted

example
JSON object

Placeholder examples. Templates will not be approved without examples.

header_text
array<string>

header_text

body_text
array<array<string>>

body_text

header_handle
array<string>

header_handle

language
string

必須
message_send_ttl_seconds
int64

Time to live for message template sent. If users are offline for more than TTL duration after message template is sent, message will be dropped from message queue and will not be delivered.

Only allowed for authentication message templates.

name
string

Template name.

必須
sub_category
enum {ORDER_DETAILS, ORDER_STATUS}

Sub category of the template

返還 類型

이 엔드포인트는 記錄 後 읽기 機能을 支援하며 會員님이 揭示한 노드를 읽습니다.
Struct {
id : numeric string,
status : enum,
category : enum,
}

誤謬 코드

誤謬 說明
100 Invalid parameter
131009 Parameter value is not valid
192 Invalid phone number
80008 There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
368 The action attempted has been deemed abusive or is otherwise disallowed
200002 HSM Template creation failed
200 Permissions error

업데이트 中

이 엔드포인트에서 遂行할 수 없는 作業입니다.

削除 中

/{whats_app_business_account_id}/message_templates 에 DELETE 要請을 만들어 a? WhatsAppBusinessAccount 에서 a? WhatsAppMessageTemplate 을(를) 分離할 수 있습니다.
Type Description

Access Tokens

User or System User

Permissions

whatsapp_business_management

Request Syntax

DELETE /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates

Path Parameters

Placeholder Value

<WHATSAPP_BUSINESS_ACCOUNT_ID>

ID of the WhatsApp Business Account that owns the template.

Response

See Return Type .

Sample Request

curl -X DELETE 'https://graph.facebook.com/
v20.0
/102290129340398/message_templates?name=order_confirmation' \
-H 'Authorization: Bearer EAAJB...'

Sample Response

{
  "success": true
}

媒介變數

媒介變數 說明
hsm_id
numeric string

ID of template to be deleted. Required if deleting a template by ID.

name
string

Name of template to be deleted.

必須

返還 類型

Struct {
success : bool,
}

誤謬 코드

誤謬 說明
100 Invalid parameter
190 Invalid OAuth 2.0 Access Token
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본