Hi How do i get the facebook profile picture?
Get facebook profile picture
Hi Bryan,
I don’t believe that it’s something you’ll be bale to do via bots as bots use the Open Graph ID for the user rather than the actual user ID and the Open Graph ID only allows access to limited information about the user.
Hey Kellsey,
Why is not possible to get the User Profile Picture using Flow XO?
If we look their API: https://developers.facebook.com/docs/messenger-platform/user-profile
They can send you profile_pic.
Can you help us?
We are developing a bot platform for Book a Table in Restaurants and it’s a really important feature for our partners see who is Booking.
Looking forward to your awnser.
Best,
Matheus
Hi Matheus,
You are right, the API could be used to get the users profile picture. You would need to use a webhook to the URL given in your link:
https://graph.facebook.com/v2.7/<USER_ID>?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=PAGE_ACCESS_TOKEN
You’ll need to:
- switch the USER_ID to the User ID returned in the flow trigger - e.g. {{catchall.user_id}}
- switch the PAGE_ACCESS_TOKEN to your pages access token - you can find this here.
You’ll get first name, last name, profile pic, locale, timezone and gender returned and will be able to use the Data Outputs to access this data.
Hope this helps.
As I am not a developer I just spent few hours trying to make this work. Here are some details that may help out:
This is the GET request on this Facebook Dev page (I guess whether you use v.2.7 or 2.6 is the same.
> https://graph.facebook.com/v2.6/<PSID>?fields=first_name,last_name,profile_pic&access_token=<PAGE_ACCESS_TOKEN>
-
<PSID>
here = {{catchall.user_id}}, note that it’s not the actual User ID of a Facebook user. It’s like a user ID generated just for your Messenger Bot. Each one of your bot users will get one. -
<PAGE_ACCESS_TOKEN>
: you FB app will need permission will need the some or all of these PAGE permission in order for the GET request to work:
Cheers
Where did you find the page where you edit the scopes? Because when I run the flow I get “{“error”:{“message”:”(#100) Invalid parameter",“type”:“OAuthException”,“code”:100,“fbtrace_id”:“Fja4TYCtqeW”}}"
Are you changing the application to your bot from the drop-down menu?
Also make sure you’re selecting the right page to get the access token
Is your bot setup to use App & Page or just the Page? See the docs for Creating a Facebook Messenger Bot for reference.
You can also check your bots menu on the Flow XO site to find this info.