When a Send API request fails, you'll receive a JSON response describing the corresponding error code
and message
. Messenger Platform errors are grouped by code, with a different message depending on the error condition.
Below is a list of common errors that you should consider handling at run-time.
{ "error": { "message": "Invalid OAuth access token.", "type": "OAuthException", "code": 190, "error_subcode": 1234567, "fbtrace_id": "BLBz/WZt8dN" } }
Code | Subcode | Message |
---|---|---|
| -- | Temporary send message failure. Please try again later. |
Code | Subcode | Message |
---|---|---|
|
| Too many send requests to phone numbers |
|
| Attachment size exceeds allowable limit |
| -- | Calls to this API have exceeded the rate limit |
|
| Warning! You are engaging in behavior that may be considered bothersome or abusive by users. You must significantly decrease the rate at which you are sending messages using message tags to this person. Further misuse of API features may result in messaging restrictions being placed on your Page |
|
| Messages to an Instant Games user have exceeded Instant Games policy. |
| -- | The ability to send commerce messages has been temporarily disabled. This is the result of a feature limit placed after a policy violation. |
Code | Subcode | Message |
---|---|---|
| -- | Invalid |
|
| No matching user found |
|
| Cannot send both message and state at the same time. |
|
| Incorrect App ID. |
|
| Invalid product id. See Product Template |
|
| Product template is not supported below version 8. Use api version 8 or higher to use product templates. See Product Template |
Code | Message |
---|---|
| Invalid OAuth access token. |
Permission errors can occur for multiple reasons but generally fit into two main categories:
Code | Subcode | Message |
---|---|---|
|
| This message is sent outside of allowed window. Learn more about the new policy here |
|
| This message is sent outside of allowed window. You need News Messaging permission to be able to do it. |
|
| This Person Cannot Receive Messages: This person isn't receiving messages from you right now. |
|
| Message Not Sent: This person isn't available right now. |
|
| Cannot message users who are not admins, developers or testers of the app until pages_messaging permission is reviewed and the app is live. |
|
| Cannot message users who are not admins, developers or testers of the app until pages_messaging_phone_number permission is reviewed and the app is live. |
|
| Requires phone matching access fee to be paid by this page unless the recipient user is an admin, developer, or tester of the app. |
|
| This person isn't available right now. |
Code | Message |
---|---|
| Invalid |
Code | Message |
---|---|
| Only available to Primary and Secondary Receivers. |
| Denying visibility of any secondary receiver to another secondary receiver other than itself. |
| The page needs to have PRIMARY RECEIVER and SECONDARY RECEIVER apps setup |
| The chat is currently controlled by Messenger while the user is in an automated question and answer flow. Please wait for the flow to finish before trying again. |
| Message failed to send because another app is controlling this thread now. |