Facebook user ID Issue - facebook

I have facebook user ID's
using this id's am accessing profile page of that particular user id.
link will be look like https://www.facebook.com/100001533612613
this link not working now.
https://facebook.com/zuck
https://www.facebook.com/100001533612613 (**not working**)
https://www.facebook.com/profile.php?id=100001533612613 (**not working**)
https://m.facebook.com/ChrisHughes
how can i see profile using UserId

how can i access profile using UserId
You can’t, because you are not supposed to any more …
You will now need to ask for the user_link permission first, and then you can request a (temporary) link to their profile via the link field.
https://developers.facebook.com/docs/graph-api/changelog/version3.0#login

Related

Facebook PHP SDK Issue with specific Facebook Id

Im using the following to retrieve information about Facebook pages that I'm the admin of. Specifically the number of likes.
// Get User ID
$page = $facebook->api($id);
return $page['likes'];
This works fine for 20 Facebook pages that I admin but I've run into one case where it does not. This is the error that I'm getting in response.
Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
I have checked that the Id being used is correct by viewing the Facebook Id Page under the admin settings. http://findmyfacebookid.com/ also runs into an error when entering the pages url.
Has anyone else experienced this? Is this a bug?
I am pretty sure you are not using an Access Token to grab the Page likes, and that one Page is restricted by age or country. Either that, or it is unpublished. Also, calling the return value "$user" may be misleading, it is not a User object, it is a Page object, right?
For restricted Pages you MUST use a User or Page Access Token of a User who can access the Page.

How do I generate Facebook like button with only the FB page ID

So I have a database table with the Facebook page ID's of my users. I would like to generate a like button dynamically with only the ID available to me to do this. The problem as I see it is that I don't know what the data-href attribute is supposed to have considering that Facebook page url's look like this: http://facebook.com/pages/hyphenated-name/<?=$FB_id?> and I don't have the hyphenated name stored in my database to generate the that url.
Is there another URL structure Facebook's back-end will accept that just has the ID and not the hyphenated name, but will still count likes on that person's Facebook fan page? Is this impossible?
You can do a look up of the id, and retrieve the link of the page stored.
example: https://developers.facebook.com/tools/explorer?method=GET&path=191825050853209
refer to: https://developers.facebook.com/docs/reference/api/page/ under link connection.
This method will require use of the graph api, or one of the sdks.
refer to: https://developers.facebook.com/docs/reference/api

How to post a COMMENT with FB application profile photo?

It is possible for a 'facebook application' to post a COMMENT on a POST when there is a valid ACCESS_TOKEN. API call for the same is: /xyz_profile_id/comments/?access_token=...
ACCESS_TOKEN being generated by allowing the "facebook application" to get access to xyz_profile_id. The post done will have default FROM ID as xyz_profile_id showing his/her profile photo along with the comment.
My requirement is this: How to change the FROM ID as appilcation_id so that the profile photo of the application is shown beside the posted comment.
Can you please provide more information on what you are doing and how you are doing it. Not sure about 'FROM ID as application_id' requirement.
E.g. posting comment to a post:
https://graph.facebook.com/<post_id>/comments?access_token=<token>&method=post&message=hi
will generate a story like this:
How do you want to change this?
In this case, you will need to authenticate your session with an application access_token, as opposed to a user access_token. Make sure the application has been installed on that particular page you want to update comments on.
Read more: http://developers.facebook.com/docs/authentication/

Facebook Get User ID From Application Tab

Facebook apps are allowed to have a tab that a user can add to his profile's tabs if he wants.
How can I get the uid or otherwise identify the currently logged in user in order to customize the layout for him please?
Thank you.
As noted here:
Facebook does not pass back who the viewing user is when she first visits your tab. Facebook does send the profile owner's ID in the fb_sig_profile_user parameter, so you know whose profile to display content for.
Visitor id is passed as request parameter after a user interacts with your tab. I can't find exact parameter name as they removed a wiki page that used to contain a list of all passed parameters, but if you dump all your request vars you should be able to see it (but not during the first visit).
some sources to do it + you must have turned on all items on migration in app settings
http://nathrondevblog.blogspot.com/2010/09/how-to-get-user-id-in-profile-tab.html
Try out this one,
If the user is logged in. You can directly get the user_id, session_key etc from the querystring.
long fbuid = long.Parse(Request.QueryString.Get("fb_sig_user"));

api to get uid from profile URL on facebook

Is there a way (using API) to get users uid from the profile URL in facebook?
The REST api has been deprecated.
The proper way to do this is to pass the profile name to the graph api
see: Facebook ID from URL
You can call the graph directly as such:
https://graph.facebook.com/username where username is the username you want to lookup.
As of today(28th July 2015), I found a different way to find Facebook user's numeric id from profile url (or username).
As you all will be knowing the profile url syntax is https://www.facebook.com/[username]
So just browse to profile url, right click to view source and search for string "uid":. You will get numeric id next to it.
Use Users.getInfo, which returns an array of user info, such as first_name, last_name, and uid. Use this call to get user data that you intend to display to other users (of your application, for example). If you need some basic information about a user for analytics purposes, call users.getStandardInfo instead.