1

I'm making a Facebook instant game, and am sending myself test messages via the associated bot.

It works. But not always, why?

Very often I get this:

{
    "error": {
        "message": "(#100) Cannot send Instant Game message to user at this time.",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2018144,
        "fbtrace_id": "DNZhKZlP83D"
    }
}

This error code is not listed in the error code documentation.

I suppose it could be some message sending limit, but I would assume that as the listed developer of the app I would be exempt from any limits.

More details just in case they are relevant

I have subscribed to the webhooks, and created a page associated with my instant game app and have the access token for it. The user I am trying to message is me, listed as the developer.

When I receive a game_play event such as:

{
    "object": "page",
    "entry": [{
        "id": "189899011738553",
        "time": 1521899151513,
        "messaging": [{
            "recipient": {
                "id": "189899011738553"
            },
            "timestamp": 1521899151513,
            "sender": {
                "id": "1647209385355472"
            },
            "game_play": {
                "game_id": "176650212970169",
                "player_id": "1293384810761815"
            }
        }]
    }]
}

I find the sender ID, and send a response like so:

{
    "message": {
        "attachment": {
            "type": "template",
            "payload": {
                "template_type": "generic",
                "elements": [{
                    "buttons": [{
                        "type": "game_play",
                        "title": "Play"
                    }],
                    "title": "Hello World"
                }]
            }
        }
    },
    "recipient": {
        "id": "1647209385355472"
    }
}

Here's the cURL version:

curl -X POST \
  'https://graph.facebook.com/me/messages?access_token=MY_ACCESS_TOKEN' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"message": {"attachment": {"type": "template", "payload": {"template_type": "generic", "elements": [{"buttons": [{"type": "game_play", "title": "HELLO"}], "title": "HELLO WORLD"}]}}}, "recipient": {"id": "1647209385355472"}}'

And just to show the access token is valid, despite the "OAuthException", and that it does really sometimes work:

enter image description here

enter image description here

Bemmu
  • 17,849
  • 16
  • 76
  • 93

1 Answers1

1

We've ensured that this error is now documented.

This message indicates that the number of messages or time window in which messages are sent to the user of an Instant Game exceeds the Instant Games bot policy.

This applies to developers and administrators as well as users of the app. Playing the game or communicating with the bot should reset these limits.

Chris Hawkins
  • 764
  • 4
  • 15
  • Hi Chris :) You say that "Playing the game or communicating with the bot should reset these limits". What about if 10 days from the last game session have passed (without activity from user)?? Can I start sending the user again or the ONLY way to reactivate the bot would be to play again?? I mean does the bot act like email where you can engage a user monthly for example – Michael Samuel Mar 11 '19 at 01:28
  • 1
    Hi Michael, that's correct. After 10 days the only way you can send a message to that user is if they play the game again or talk to the bot. – Chris Hawkins Mar 11 '19 at 21:28
  • Thanks very much Chris for the quick response :) – Michael Samuel Mar 11 '19 at 23:38