background preloader

API facebook

Facebook Twitter

Using the Graph API. All nodes and edges in the Graph API can be read simply with an HTTP GET request to the relevant endpoint.

Using the Graph API

For example, if you wanted to retrieve information about the current user, you would make an HTTP GET request as below: GET /v2.3/me HTTP/1.1 Host: graph.facebook.com /* PHP SDK v4.0.0 *//* make the API call */ $request = new FacebookRequest( $session, 'GET', '/me'); $response = $request->execute(); $graphObject = $response->getGraphObject();/* handle the result */ /* make the API call */ FB.api( "/me", function (response) { if (response && ! Response.error) { /* handle the result */ } }); // For more complex open graph stories, use `FBSDKShareAPI`// with `FBSDKShareOpenGraphContent`/* make the API call */FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"/me" parameters:params HTTPMethod:@"GET"];[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { // Handle the result}]; Choosing Fields URL Lookup.

Graph and Ads API Rate Limiting. As the below diagram shows, there are 3 types of throttling for graph api calls.

Graph and Ads API Rate Limiting

Each api call will go through these different levels of throttling during its life time. When an api call passes the top level throttling, it is subject to be throttled at the second level and so on. See the rate limiting flow diagram here: User Level Rate Limiting This rate limiting is applied at the user level for all api calls except for Marketing APIs. Rate limitations happens real time on sliding window.Each call is assigned a score. Recommendations: Verify the error code (17) to confirm the throttling type.The call will be blocked for 30 minutes.Switch to another user and come back to this user later.During this time the max score will decay at rate of x points/second where x = n / 3. How-To: Handle expired access tokens- Facebook Developers. One of the most frequently asked for “How-To” requests from developers is how to handle invalid access tokens. Access tokens for users can become invalid due to various reasons. In most cases, they can expire if it’s past the time specified by the ‘expires’ field (by default access token have a 2 hour lifetime).

What many developers do not realize is that an access token can also expire if a user changes her password, logs out or if she de-authorizes the app via the App Dashboard . Facebook Platform Versioning. Not all APIs and SDKs share the same versioning system.

Facebook Platform Versioning

For example, the Graph API is versioned with a different pace and numbering compared to the iOS SDK. All SDKs released after 30th April 2014 support the ability to interact with different versions of our APIs. Multiple versions of APIs or SDKs can exist at the same time with different functionality in each version. Why do we have versions? An Update on Login Review - How to Get Your App Approved Quickly & Easily. This year at f8, we rolled out Login Review as a new part of our app review process, extending our existing App Center and Open Graph reviews.

An Update on Login Review - How to Get Your App Approved Quickly & Easily

We heard from people that some apps ask for too many permissions — so we wanted to create a simple, quick process to make sure developers request only the permissions that make sense for their apps. During Login Review, we review any permissions that an app requests beyond public profile, e-mail, and friend list (apps don't need to submit for review if they're only asking for these three permissions).

We’ve reviewed over 25,000 apps in the past six months, and on average apps finish their review in less than a day[1]. Below are a few things we've learned from Login Review, and tips on how app developers can quickly and easily get their apps approved. Results. RestFB - A Lightweight Java Facebook Graph API and Old REST API Client. Access Tokens. Facebook's official SDKs manage the lifetime of tokens for you.

Access Tokens

When using iOS, Android or our JavaScript SDK, the SDK will handle making sure that tokens are refreshed before they expire. Native mobile applications using Facebook's SDKs will get long-lived access tokens, good for about 60 days. These tokens will be refreshed once per day when the person using your app makes a request to Facebook's servers. If no requests are made, the token will expire after about 60 days and the person will have to go through the login flow again to get a new token. Access tokens on the web often have a lifetime of about two hours, but will automatically be refreshed when required. Here are the steps that you need to take to generate a long-lived token:

Send Requests - Développeurs Facebook. In this section: Overview The Requests Dialog is a pre-built UI component that allows people using your app to send notifications to their friends.

Send Requests - Développeurs Facebook

The Requests Dialog can be implemented with a few lines of code. There's no need to build native dialogs, make API calls or handle responses. The Requests Dialog is supported through the FBWebDialogs class that contains convenience class methods that you can use to show the Requests Dialog. Notifications sent by your app are only received on mobile devices if your app is a game. Feed Dialog - Développeurs Facebook. In this section: Overview The Requests Dialog is a pre-built UI component that allows people using your app to send notifications to their friends. The Requests Dialog can be implemented with a few lines of code. There's no need to build native dialogs, make API calls or handle responses. The Requests Dialog is supported through the FBWebDialogs class that contains convenience class methods that you can use to show the Requests Dialog.

Notifications sent by your app are only received on mobile devices if your app is a game. In this tutorial we will walk you through a Request Dialog implementation step-by-step. Sending a request.Sending additional data with a request.Sending an invite triggered when a person has used the app a certain number of times.Handling request app links from the Facebook for iOS app.Sending requests targeted to people using certain devices, ex: iOS. For your reference, the completed sample is also available on GitHub. Prerequisites. Facebook iOS SDK 3.x feed dialog is gone. Iphone - Facebook: sending an iOS access token server side and signing with App Secret.

Facebook - Why can't I use server-side flow oauth tokens for an iOS app feed dialog.