Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The parameter user_id is required #61

Closed
hitamu opened this issue Jul 17, 2017 · 2 comments
Closed

Error: The parameter user_id is required #61

hitamu opened this issue Jul 17, 2017 · 2 comments

Comments

@hitamu
Copy link

hitamu commented Jul 17, 2017

Hi,
I'm using bot with conversation as bellow

  bot.on('postback:QUIZ_TEST', function(payload, chat) {
    chat.say("Let' do quiz test", {typing: true}).then(function() {
      chat.conversation(askQuiz)
    })
  })

Then I faced this kind of error.

Error sending message: FetchError: request to https://graph.facebook.com/v2.6/me/messages?access_token=xxx failed, reason: getaddrinfo ENOTFOUND graph.facebook.com graph.facebook.com:443

When I query by this url via browser I got a message from response of FB

{
error: {
message: "(#100) For field 'messages': The parameter user_id is required",
type: "OAuthException",
code: 100,
fbtrace_id: "BQLNcgIP4cd"
}
}

It's seem like chat or convo which I used was missing recipient_id (user_id).
I can explicit pass it by using only bot.say(userId, ...) but it's inconvenience.

Thanks in advance.

@mraaroncruz
Copy link
Collaborator

It should work the way you are trying to make it work.
I think the two errors are for different things.

How did you make the second request?
Can you console.log(chat) your chat before you call chat.conversation() and see if it includes your user id?

@hitamu
Copy link
Author

hitamu commented Jul 20, 2017

@mraaroncruz Thanks for your comment. Your question pointed me out.

How did you make the second request?

I did a mistake when try to call request via browser, it's a GET method (from browser) that why I get the second error.

Maybe the first error caused by network problem and I cannot reproduce it.
Anyway, thank you.

@hitamu hitamu closed this as completed Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants