How to get an facebook access token for URL - facebook

i need to get ids of users who likes particular url, i get an facebook URL object id through FQL
SELECT id FROM object_url WHERE url = 'myurl'
In return i get for example 500504199505
Now, when i need to get the list of users who likes that url, i need to use graph api like that:
https://graph.facebook.com/500504199505
Or FQL like that:
SELECT user_id FROM like WHERE object_id='500504199505'
But!!!! For that i need an authorisation token.
So you have to provide an access token with your request associated with an admin account of the page you are trying to get the fans.
But i have just used a social plugin and pasted it to my site, so how can i get that token, how can i be an administrator of particular URL. I am bit confused.
Thanks for help anyone!

Check out:
Facebook Graph API — getting access tokens
Hope that helps.

Related

In FB Graph API Explorer, what's the difference between /me/likes and /{id}/likes

I think this is a basic question.
When I use the API explorer with the path /me/likes, I get a list of my likes. My access token has the user_likes permission.
When I change me to my facebook id and use the same token as above, I get back an empty list. I've verified the id is the correct one because exploring /me does correctly return my name.
What is the semantic difference between me and my id?
The token from the Graph API for an 'app', so it is interpreting me according to it's own app-scoped id for me. The id I had been substituting was my accounts original id. Both ids point to the same person (me).
Thanks CBroe.

Get Instagram profile page from an id

I have been using Factual Places & Crosswalk API to get Social Media links on some specific places on my iOS app. The API returns proper links for Facebook & Twitter. But for Instagram it just return an id, something like this 79471948.
I was wondering how I can make use of this id. I thought I could use it in a URL, something like this. http://instagram.com/79471948, But this does not exists.
Then I thought the id could be a user-id. If it is a user-id I wanna get the username of the corresponding user-id so that I open his profile page something like this http://instagram.com/79471948. But as we know that Instagram does not allow us to directly request for User Data without OAuth we can't get access token. Without getting access token, I cant get the username.
So do you guys have any suggestions? So the whole thing is, I have this id 79471948 and I wanna open up the corresponding profile without doing any OAuth.
Thanks in Advance.
You have to use API to get the user profile from user-id.
https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN
https://www.picodash.com/# allows you to search for a user-id and view the full profile or open actual instagram.com/username link and view.

Get Facebook like count using the API

I'm trying to get the number of Facebook likes using the API for the page of the organization I work for - https://www.facebook.com/giftoflife. (The number is about 150k.)
https://graph.facebook.com/110653755631234/insights/page_fans simply returns no data (I'm using the correct access token).
What am I doing wrong?
EDIT
I need to use the insights API specifically, as I need to get the likes within a specific date range.
Getting the number of likes for a Page is actually a lot easier, you don´t need the insights for that, and only an App Access Token:
https://graph.facebook.com/giftoflife
You only need a User or Page Token for that if the Page is restricted (age/country).
If you want to get access to Insights, make sure you got a Page Access Token with the read_insights permission. You can debug your Access Token here: https://developers.facebook.com/tools/debug/

facebook graph api if a user has liked a page

I am trying to use facebook graph api to find out if a user has liked a particular page.This is the query I tried
https://graph.facebook.com/user_id/likes/page_id?access_token="my access token"
I tried the same kind of query to find if two users are friends but its returning empty data set even for that.
https://graph.facebook.com/user_id/frineds/user_id
How should I solve that issue?
You can use
GET /v2.2/{user-id}/likes/{page-id}
to find out if a user likes a page. Remember that you need the user_likes permission!
See
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/likes#readmodifiers
For seeing if a user is a friend of another user, try
GET /v2.2/{user-id-a}/friends/{user-id-b}
You need the user_friends permission to do so.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends#readmodifiers

Get Facebook's friends birthdays in Objective C

i found a site like graph.facebook.com but I cannot understand this API, so I wanted to know if there's a way to get the friends birthday (e.g. as an HTTP Request) ?
Please help,
Thanks in advance!
Just glancing over the documentation, it seems that you would need the user's authorization:
Look at the user api: http://developers.facebook.com/docs/reference/api/user
from http://developers.facebook.com/docs/api:
The Graph API as such allows you to easily access all public information about an object. For example, https://graph.facebook.com/btaylor (Bret Taylor) returns all the public information about Bret. For example a user's first name, last name and profile picture are publicly available.
To get additional information about a user, you must first get their permission. At a high level, you need to get an access token for the Facebook user. After you obtain the access token for the user, you can perform authorized requests on behalf of that user by including the access token in your Graph API requests
Here is an example done in FQL: Fetching friends' birthdays from facebook profile
FQL: http://developers.facebook.com/docs/reference/fql/