Get Facebook's friends birthdays in Objective C - facebook

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/

Related

How to get my own Facebook user timeline using Graph API?

I would like to get all the posts and updates that are normally displayed in FB official application for MY account (this includes updates from my friends and liked pages).
I wasn't able to find any details how to get that, the only thing I've managed to get is my own posts.
Anyone got any experience with that using current Graph API verion (3.3)?
All the alternate FB clients (ex. Friendly) must be doing this somehow.
There is no way to get ANY data of users who did not authorized your App. Which means, there is no way to get posts of friends. You can only get your own friends, with the user_posts permission and the /me/posts endpoint. If some Apps access friend data without their authorization, they are most likely doing something that is not allowed.
Here is what I found in their API docs:
There are two scopes:
The user feed requires the user's permission
The public feed has fewer capabilities but doesn't require perms

Get likes of public photo on facebook

I'm trying to get photo data (like likes) using the graph api, but it appears that some photos give me the data, but others return "Unsupported get request".
I'm only testing public pictures, using GET /photo-id.
This photo, for example, returns "Unsupported get request", as you can see here.
Other photos do work, this one, for example.
Any ideas? Thanks a lot!
The difference is that one photo is created by a Page and the other one is created by a User. You can only get the User photos with a User Access Token, even if it´s a public one. For Page photos, you can use an App Access Token or a Page Access Token.
See those links for more information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Of course you also need to request the user_photos permission in the login process to get access to the User photos.
Btw, the user_photos permissions needs to get approved if you want to make it work for all Users. Without approval, it will only work for App Admins. See changelog and review guidelines:
https://developers.facebook.com/docs/apps/changelog
https://developers.facebook.com/docs/apps/review
Error 100 indicates a syntax error in the URL you are posting to. Are you using a custom graph URL set? If so, double check it.

Facebook status updates from my own fan page

I am trying to retrieve my own facebook posts to show on my website.
Looking at SDK documentation I couldn't find it anywhere, neither with the FQL queries.
I could only find how to get the logged user statuses.
Is there a way to do what i need?
Thanks in advance.
You need to be authenticated to get access to the feed API object or stream FQL table. Both return your Facebook posts.
The easiest is to create an app, and use your app id to authenticate, then make this API call:
$result = $facebook->api('/USER_ID_OR_USERNAME/feed', 'GET');
You'll be limited to public updates. If you want more detailed updates, you will need to authenticate the person whose stream you wish to get, obtain a long-term access token and store this in your database.

Facebook Graph API: shouldn't /userId/subscribers list subscribers for non-friends?

From the docs: https://developers.facebook.com/docs/reference/api/user/#subscribers
I was testing on Graph API Explorer and noticed that I can't get the public subscribers list from a non-friend person through that API connection even when I can see them via http://www.facebook.com/userId/subscribers page.
It retrieves only the summary info with total_count, nothing on data. Am I missing something or it's unsupported by design?
Thanks!
Yes this is by design, the API doesn't reflect the public interface, it's best not to think about it like this. Always see the permissions needed
You can read the subscribers for a user for your app by issuing an HTTP GET request to /USER_ID/subscribers with the user access_token with the user_subscriptions or friends_subscriptions permission.
So as it says you can only read the authenticated user and the user's friends with the correct permissions.

How to get an facebook access token for URL

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.