Not able to load the Image from facebook response - facebook-login

I'm using Auth0 api for login. I have received facebook response in which user profile picture is as below:-
https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ
But when I'm trying to refer this image as below, I'm not able to retrieve the image.
<img src="https://lookaside.facebook.com/platform/profilepic/?asid=1324218274262199&height=50&width=50&ext=1525319136&hash=AeSrHdLSZSZhBkyQ">
Any can give me any expert advice why its happening.? I'm not able to find any related docs.

You should use the image by calling the picture attribute from your user object. So for example, we can use the access_token we receive upon authentication to call the /userinfo endpoint to get the user profile (this information is returned as a JSON object) at which point we can do something like userProfile.picture. If you are still having trouble can you please share your code?

Related

How to get a valid access token to query search result from Facebook graph API

I want to collect all the Facebook link from Facebook search function. What I'm using here is the Facebook graph API tool.
If I want to query the data for a keyword, for example: "limited";
I will use the URL:
https://graph.facebook.com/v11.0/search?q=limited&access_token={my_access_token}
My image
However, I got the result as in the image. When I tried to create a workplace app and tried to get the access token of that app, I got the message as in the second image.
Error message when getting the access token of a workplace app
What I need now is an access token that has the permission to retrieve the data from the Facebook search. After that, I can use python to handle the rest.
Please help me out, thank you very much!

How to programmatically post like and comment an URL on facebook?

This is confusing. So just to clarify:
REQ #1: To fetch basic stats for a URL, you send GET request to:
http://graph.facebook.com/?ids=http://some.com
(alternatively, FQL can be used to fetch stats for a URL, but that doesn't return the OpenGraph Object)
REQ #2: To fetch comments for a URL, you do a GET:
http://graph.facebook.com/comments/?ids=http://some.com
REQ #3: To fetch likes for a URL, you GET:
http://graph.facebook.com/likes/?ids=http://some.com
But how do you comment on / like a URL programmatically?
I guess, likes can be created using Open Graph API, right?
https://graph.facebook.com/me/og.likes?object=1234
where 1234 is the OpenGraph Object ID of an article (as returned by REQ #1).
But this requires an approval process, the like action has to be approved by Facebook.
Is there a better way to do this? Can I use for example the Graph API for all these things?
My goal:
Currently I'm using the Facebook like button and comments plugin to create likes and comments. But these use the JS SDK, which is huge, and they generate a lot of external requests. I wanna get rid of them and just send an AJAX request to my server, which would then asynchronously talk to Facebook, and it would post the Like / Comment.
Is this possible?
Thanks in advance!
I read through the Facebook docs briefly and I don't believe you can do this other than the way you indicated with authenticating.
You should also take a look at this thread: 'Like' a page using Facebook Graph API
You would need to authorize every single user before he would be able to like something, and you would need to go through a review process on Facebook. And i am pretty sure you would not get the required permissions approved just because you want to get rid of the JavaScript SDK overhead, to be honest.
The Social Plugins are asynchronously, so the overhead for downloading the SDK is irrelevant as it happens in the background and it is non-blocking.
I have an idea, to do this. You can use long term access token, Once you login you receive short term token. After receiving short term token you need to request your long term access token. Save that token in DB or file.
Then you can use Graph Api, to make requests. This will eliminate the need for access requirement every time you request api.
Just use access token you saved before.
Refer this documentation from Facebook for further clarity.
https://developers.facebook.com/docs/facebook-login/access-tokens
Happy Coding!
Atul Jindal

How to post photo/image to facebook wall

How to post an image to friend's facebook wall through graph api?If anybody suceed please send the web reuest or graph url.Here is my graph url.
https://graph.facebook.com/Pageid/feed?access_token=application_access_token&method=post&picture=http://www.Google.es/images/srpr/nav_logo39.png&message=logo
It is working fine ,image get posted on the page.But when I am trying to give url of image (that stored on my desktop)logic get fails.Here is it's url.
https://graph.facebook.com/Pageid/feed?access_token=application_access_token&method=post&picture=D:/foldername/Cimage.jpg&message=Waterfall.
I can't directly put all image that user upload to my server and then post to facebook.I wanted user to directly post an image to facebook wall not through my server (I don't want any image that hosted somewhere I wanted to use the image that get stored on harddisk.)

How to post a message on wall of facebook using a graph api

How to post a message on the wall of facebook or add comment to the thread using a graph api.I want a url of that.
like for adding a message to wall
https://graph.facebook.com/profile_id/feed?access_token=generated token&message=hi
But it not working ,it not get added to my wall.
You need to add &method=post to your request URL. Also, you must have the `publish_stream extended permission for your application.
https://graph.facebook.com/user_id/feed?method=post&message=hi&access_token=generatedtoken.. will work
instead of profile id give the user id
Hope this will work

Facebook API Graph - posting a status update to a Facebook Page

I am following the Facebook developer documentation for making a post to a Facebook 'Page' as the Page itself, which according to the docs requires impersonation. I've gotten the access token for the page itself, as well as the Page's ID, by making a call to the "accounts" feed for the user who's the admin for the Page. I then POST to
https://graph.facebook.com/[Page_ID]/feed
With the post items
access_token
and
message
containing the access token and the message, and I get a JSON string back with a post ID. Which all seems to indicate that it is posting the message to the page. HOWEVER, when I go to the particular Page, it doesn't display the posted status.
Does anyone perhaps have any idea why that might be?
Thanks in advance everyone!
Did you make sure to get the "publish_stream" permission from the user?
http://developers.facebook.com/docs/authentication/permissions