bootbot
bootbot copied to clipboard
Parameter error: You cannot send messages to this id
This call:
bot.say(user_id, "hello")
Results in the following error:
(Messenger Error received. For more information about error codes, see: https://goo.gl/d76uvB
{ message: '(#100) Parameter error: You cannot send messages to this id',
type: 'OAuthException',
code: 100,
fbtrace_id: 'EiRBnjXA1uA' })
The user_id
parameter is the payload.sender.id
from bot.on('message')
callback.
What bugs me is that it works on my local machine, however it doesn't on my remote server, even using the very same user_id
in both machines.
Any hints?
Check your app ID and page token. Make sure they're not null and correct for the correct page.
Hello!
I checked, they're equal on both machines.
Just to be clear, bot.on('message')
works on both machines, while bot.say
only works on one of them (my local machine).
It sounds like a facebook page token issue. Are you sure that the page tokens match the app you are expecting to use?
User ID's are page scoped so this sounds like you are trying to send to a user that is connected to a different page. So FB's like "Who is this?"
I can almost guarantee that your facebook page token is incorrect.
- Go to the app in developers.facebook
- Go to Settings => Basic
- Look at the App ID (and secret), make sure it is what you are using in production
- Now go to Messenger => Settings in the left menu
- Select the page you are sending to and from
- Make sure the token is the same you have in production with the app id above