-1

I'm a page admin and trying to debug messanger bot. Recently, I've changed the password and now when I try to reply to myself in messager via API I get an error

{
  "error": {
    "message": "Error validating access token: The session has been invalidated because the user changed their password or Facebook has changed the session for security reasons.",
    "type": "OAuthException",
    "code": 190,
    "error_subcode": 460
  }
}

The thing is I don't have an access token, to begin with, the doc says

To send messages to someone on Messenger, the conversation must be initiated by the user.

It also says

Apps in Development Mode, are restricted to message people that have a role in the app.

I've tried to

  • Recreate page token
  • Block/Unblock page and delete conversion
  • Tried to remove myself from admins, but that's impossible since I'm the only admin

The only option I see left is to remove the app altogether and create a new one, but that doesn't seem like a good solution

Nikita Misharin
  • 1,961
  • 1
  • 11
  • 20
  • _“The thing is I don't have an access token”_ - if you had no access token, then you would not have had a working bot at any point. – CBroe Jan 12 '21 at 07:18
  • As I said, "To send messages to someone on Messenger, the conversation must be initiated by the user.". Please check the docs, the only needed token is page token, but I have reset it and it does nothing – Nikita Misharin Jan 12 '21 at 09:24
  • Yes, and _because_ you need a page token, you saying “I don’t have one, because the user needs to start the conversation”, makes just _zero_ sense. _“now when I try to reply to myself in messager via API I get an error”_ - then your bot is apparently still using the _old_ page access token. You said you generated a new one, but it sounds like you might have forgotten to actually update it in your bot config or something. – CBroe Jan 12 '21 at 10:02
  • Oh, wow ‍♂️ I had two configs with access token and I updated the wrong one. Thanks for the help! Do you mind answering the question. So I could mark it best? – Nikita Misharin Jan 12 '21 at 10:23

1 Answers1

1

This has nothing to do with the fact that the user needs to message your page first, before the bot can respond.

Your bot needs a page token to perform its actions, and according to the error message, the one you have been using, had expired.

So the token you got set in your bot configuration needs to be replaced with a fresh, valid one.

CBroe
  • 91,630
  • 14
  • 92
  • 150