guidone / node-red-contrib-chatbot

Visually build a full featured chat bot for Telegram, Facebook Messenger, Whatsapp and Slack with Node-RED. Almost no coding skills required.
http://red-bot.io
943 stars 191 forks source link

Facebook - Unable to get profile info for user #234

Closed lexoyo closed 6 years ago

lexoyo commented 6 years ago

Hello Thank you for this great nodes, I love how easy it is to use it with telegram For Facebook, I am struggling with this error message: "Unable to get profile info for user 15610324xxxxxx - (#100) Insufficient permission to access user profile" Would you know where that comes from? Have a nide day! screenshot from 2018-08-18 17-24-08

lexoyo commented 6 years ago

I think this was due to my Facebook messenger app status. I published it in Facebook, now it is live like this:

screenshot from 2018-08-19 22-38-01

But now it gives me another error when a user sends a message to the bot:

Unable to get profile info for user 2017023xxxxxxxxx - Unsupported get request. Object with ID '2017023xxxxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

And my flow is as simple as this:

screenshot from 2018-08-19 22-39-50

guidone commented 6 years ago

Hi @lexoyo , sorry for the late answer. I had similar problem in the past, I had to regenerate the access token and it worked, let me know if it works

lexoyo commented 6 years ago

Thank you @guidone for your time I tried again and again, recreating everything, following this tutorial

Always the same error in the console screenshot from 2018-08-26 16-18-38

But I noticed this in the terminal where I started rednode, so it does receive the messages from messenger?

-------------------------- Error in chat-platform.js ---------------------------
Unable to get profile info for user 1722348371197685 - Unsupported get request. Object with ID '1722348371197685' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api                                                                               

26 Aug 16:15:02 - [error] [chatbot-facebook-node:5aa18c0c.17f4ac] Unable to get profile info for user 1722348371197685 - Unsupported get request. Object with ID '1722348371197685' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api             

─
lexoyo commented 6 years ago

oh wait here is the complete message from the terminal:

-- INBOUND MESSAGE --
sender: 
  id: 1722348371197685
recipient: 
  id: 304845966957443
timestamp: 1535292901352
message: 
  mid:  RwMPXS3HvfX2BRxGX_SDYSxHGXY10xySikwP7j21HJA8QQdbAMsUMOA6KQwC2r58Y5x9wztRcdfUlKDd_8lsRA
  seq:  92
  text: dddd

-------------------------- Error in chat-platform.js ---------------------------
Unable to get profile info for user 1722348371197685 - Unsupported get request. Object with ID '1722348371197685' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api                                                                               

26 Aug 16:15:02 - [error] [chatbot-facebook-node:5aa18c0c.17f4ac] Unable to get profile info for user 1722348371197685 - Unsupported get request. Object with ID '1722348371197685' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api             
lexoyo commented 6 years ago

Hi again I'm sorry to bother you, it's probably in the config of my facebook app The middleware which throws the error is the one which retrieves the user profile, and in particular this line, if I change the requested fields from fields: 'first_name,last_name,profile_pic,locale,timezone,gender' to fields: 'first_name,last_name it works I can't find where I missed these access rights :-/

guidone commented 6 years ago

Ok, it's good to know. It's worth writing to something about it in the wiki, I'll get back to you by the eod

lexoyo commented 6 years ago

Let me know how I can help Maybe change the code and make these rights an option? Or write in the wiki Bye!

guidone commented 6 years ago

@lexoyo after some reading seems like the field causing the problem is profile_pic which is not used in RedBot, so I left just first_name, last_name and locale which are part of the core (always available). So no need for configurable option for now.

Thanks very much for the feedback, I guess this problem was afflicting many users.

This is fixed in version 0.14.5

🖖 Guido

lexoyo commented 6 years ago

woohoo, thx! :vulcan_salute:

lexoyo commented 6 years ago

just a question, would it be hard to add a platform? I'm thinking hangout chat

guidone commented 6 years ago

No, you can make some experiments with

https://github.com/guidone/node-red-contrib-chatbot/wiki/Universal-Connector-node

lexoyo commented 6 years ago

Ok, I'll see about that I did this for hangout chat https://www.npmjs.com/package/node-red-contrib-hangouts-chat