This document provides answers to frequently asked questions.
アプリのインストールはアプリのウェブサイトから行い、 Facebookログイン を使用して特定のページにpages_messagingアクセス許可を付与します。認証済みアプリは、[メッセージの詳細設定]内の[ページ設定]で確認できます。
はい、1つのFacebookアプリが複数のページをフォローすることはできます。pages_messaging権限などのアプリレビューを通過したアプリは、複数のページのWebhookを受け取るようにフォローすることができます。ペイロードに基づいて、各Webhookから取得するコンテキストは自由に決められます。
はい、複数のアプリをページにサブスクリプション登録できます。複数のアプリで同じスレッドを扱う場合に最適な方法は ハンドオーバープロトコル を使ってスレッドを所有するボットを常に管理することです。
GDPRとMessengerプラットフォームのよくある質問については、「Messengerプラットフォームと一般データ保護規則(GDPR)」をご覧ください。
「Messengerに送信」プラグインを使用する際に、data-refパラメータをパススルーパラメータとして使うと、クリックのコンテキストに関する情報を通じて送信できます。
また、利用者はMessengerの検索機能を使用してあなたのページを見つけることもできます。このような場合、パススルーパラメータは使用できません。アカウントのリンク機能を使用すると、スレッドをサイトのユーザーアカウントに関連付けることができます。
No. Unlike subscriptions where a business can send multiple messages to people on a recurring basis, the one-time notification API limits the business to a single message per user request. If the person engages with the message, the standard messaging window will reopen.
Yes. Pages interested in using the One-time Notification API need to apply for permission. Go to the Advanced Messaging section of your Page Settings and consent to the terms. A Page will be granted permission if the Page meets our criteria.
Common uses of the API include various promotional and non-promotional use cases where the User explicitly requested a follow-up. Examples include:
Your Page is not allowed to send a notification on a topic for which the User has not agreed to receive a notification. Please see the Usage and Restrictions and Limitations sections of the One-time Notification guide for more information.
A Page can send multiple requests however, the 24-hour policy will be applied to all the requests being sent. We also have controls in place to prevent spamming users with multiple requests.
The 24 hour standard messaging window will open only if the user interacts with the opt-in message. The behavior is consistent with interactions with other elements in the Messenger experience.
Pages will need to subscribe to message_optins webhook to receive notifications about User consent.
Once a person asks to be notified, the Page will receive a token which is equivalent to a permission to send a single message to the person. The token can be used to send a message to the person outside the 24 hour window. The token can only be used once and unused tokens will expire within 1 year of creation.
Yes. However, while it is possible to send another notification request using an existing token, there is no clear benefit for the business to send these type of requests.
Token is for one-time use only. Once a token is used it can not be used again.
No. The API does not return tokens available to a Page.
Page level. Permissions for the One-time Notification API are given at the Page level.
No. The app does not need to specify any message tags when sending a message outside the 24-hour standard messaging window using this API.
このような場合、次のようにいくつかの原因があります。
Here is a workaround to use a platform test user for your messenger platform integration:
https://graph.facebook.com/v4.0/me/accounts?access_token=[TEST_USER_ACCESS_TOKEN](Documentation)
https://graph.facebook.com/v4.0/me/subscribed_apps?method=POST&access_token=[TEST_USER_PAGE_ACCESS_TOKEN](Documentation)
GET /oauth/access_token? grant_type=fb_exchange_token& client_id={app-id}& client_secret={app-secret}& fb_exchange_token={short-lived-token}
If your business tries to send an update message that falls under one of the approved use cases in message tags, we’d recommend you to still tag it using messaging_type=MESSAGE_TAG with an appropriate message tag. That way you don’t need to keep track of whether a conversation is still within under the 24-hour window in standard messaging.
Under the standard messaging policy apps can't send messages outside the 24-hour window. The message will fail to be sent. If a message tag is used the message can be sent outside the 24 hour period as long as is one of the supported use cases and the app is in good standing.
いいえ、Messengerプラットフォームは、ボットからメッセージを受信することを選択したすべてのユーザーのPSIDのリストを返すAPIを提供しません。
コールバックの受信には2つの手順が必要です。まず、webhookが正しく設定されていることを確認します(https://developers.facebook.com/docs/messenger-platform/webhook-reference#setup)。webhookが適切に設定されていることを示すインジケーターがあります。
次に、各ページをフォローします。フォロー対象のページはすべてリストに表示されます。
webhookへの呼び出しが長期間にわたって失敗する場合は、アプリのフォローが解除され、webhookやページの再フォローが必要になります。
webhookへの呼び出しには、X-Hub-Signatureという名前のヘッダー内にフィールドが含まれます。このフィールドを使用すると、呼び出しがFacebookから来たものであることを検証できます。
webhookからの応答のステータスコードが200になっていることを確認してください。これは、webhookが正しく受信されたことを示します。200が返されない場合は、正しく処理されるまで呼び出しが繰り返されます。また、webhookが長期間にわたって200を返さない場合は、開発者アラートが表示されます。
成功のステータスコードは時間通りに返されます。webhookの呼び出しは20秒後にタイムアウトします。成功のステータスコードがただちに返されて個別に処理されるように、このwebhookのようなコードは非同期に処理されるように設定してください。
There is a tool that shows recent webhook errors. If webhooks are failing to be delivered, Meta servers will unsubscribe your URL. To find the tool, go into your App dashboard > Messenger > Settings, inside the Webhooks card there is a button called Show recent errors