bootbot icon indicating copy to clipboard operation
bootbot copied to clipboard

chat.getUserProfile() not working

Open sarimhaq opened this issue 7 years ago • 7 comments

When I call chat.getUserProfile() I am getting the following error: { error: { message: '(#100) Insufficient permission to access user profile.', type: 'OAuthException', code: 100, error_subcode: 2018247, fbtrace_id: 'AMhQXIgh4lW' } }

sarimhaq avatar Aug 18 '18 21:08 sarimhaq

Hey @sarimhaq, that's probably because the user needs to opt-in by chatting with your bot first. You can check the list of pre-requisites to make this request here: https://developers.facebook.com/docs/messenger-platform/identity/user-profile

Charca avatar Aug 20 '18 13:08 Charca

Update Facebook url in /bootbot/lib/BootBot.js remove const url = https://graph.facebook.com/v2.12/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken} add const url = https://graph.facebook.com/${userId}?fields=first_name,last_name,profile_pic&access_token=${this.accessToken}

jeandybryan avatar Aug 20 '18 20:08 jeandybryan

Thanks @Charca and @jeandybryan !

sarimhaq avatar Aug 23 '18 23:08 sarimhaq

@Charca Can you update Facebook graph api url in the source code? I got the problem too while updating from API ver 3.0 to 3.1.

phamngocduy98 avatar Sep 06 '18 04:09 phamngocduy98

We should probably make the Graph API version an optional param of the BootBot constructor and default to not use a specific version. If anyone wants to jump in and open PR with this change, it should be a pretty straightforward update.

Charca avatar Sep 12 '18 00:09 Charca

I created a PR in #161. I have just contributed to open source project recently (like this is my 5th PR). So please review my PR and send me any comments if the PR needs more update. Thank you.

lehainam-dev avatar Oct 28 '18 19:10 lehainam-dev

Update Facebook url in /bootbot/lib/BootBot.js remove const url = https://graph.facebook.com/v2.12/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken} add const url = https://graph.facebook.com/${userId}?fields=first_name,last_name,profile_pic&access_token=${this.accessToken}

yeah for me, timezone wasnt approved yet, just removed timezone and it worked.

Thanks alot

theproj3ct avatar Oct 24 '19 14:10 theproj3ct