https://graph.facebook.com/v19.0
/me/messages?access_token=<PAGE_ACCESS_TOKEN>
curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"<PSID>"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"What do you want to do next?",
"buttons":[
{
"type":"web_url",
"url":"https://www.messenger.com",
"title":"Visit Messenger"
},
{
...
},
{...}
]
}
}
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
{ "recipient_id": "1254477777772919", "message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P" }
recipient
메시지 받는 사람의 설명. 모든 요청에는 id
, phone_number
또는 user_ref
중 하나가 포함되어야 합니다.
속성 | 유형 | 설명 |
---|---|---|
| 문자열 | 메시지를 받는 사람의 |
| 문자열 | 선택 사항. 받는 사람의 전화번호(형식: +1(212)555-2368). 이 방법으로 메시지를 보내려면 봇의 고객 매칭 기능 사용이 승인되어야 합니다. |
| 문자열 | 선택 사항.확인란 플러그인의 |
| 개체 | 선택 사항. {"first_name":"John", "last_name":"Doe"} 이름을 지정하면 매칭 성공 확률이 증가합니다. |
message
Property | Type | Description |
---|---|---|
| Object | An object describing attachments to the message. |
message.attachment
Property | Type | Description |
---|---|---|
| String | Value must be |
| Object | 템플릿의 |
message.attachment.payload
속성 | 유형 | 설명 |
---|---|---|
| 문자열 | 값은 |
| 문자열 | 640자 이내의 UTF-8 인코딩 텍스트입니다. 텍스트는 버튼 위에 표시됩니다. |
| 배열<button> | 행동 유도로 표시되는 1~3개의 버튼으로 구성된 세트입니다. |