Open sarimhaq opened 6 years ago
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
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}
Thanks @Charca and @jeandybryan !
@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.
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.
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.
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
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' } }