Skip to content

Instantly share code, notes, and snippets.

@earth2marsh
Created October 25, 2010 03:08
Show Gist options
  • Save earth2marsh/644323 to your computer and use it in GitHub Desktop.
Save earth2marsh/644323 to your computer and use it in GitHub Desktop.
Docs for Apigee's Heroku Add-on for Facebook

Apigee for Facebook

Apigee makes working with APIs better. Using Apigee to mediate Facebook API requests provides developers with analytics that provide API performance metrics, help understand usage, view requests and responses, and dig into errors using the debugger.

Add-on Installation

To use on Heroku, install the add-on with:

$ heroku addons:add apigee_facebook

Local setup

Activating the add-on will create a private Facebook Graph API endpoint for you as a configvar. To use it, simply make any normal request as you would to graph.facebook.com or api.facebook.com, but instead use the configvar APIGEE_FACEBOOK_API_ENDPOINT in place of graph.facebook.com.

Additional Resources

Apigee for Twitter

Apigee makes working with APIs better, especially the Twitter API. By accessing the Twitter API through Apigee, you can receive significantly improved Twitter API rate limits when using OAuth authentication. This removes a major barrier for developers building Twitter applications - with the Apigee add-on, you can now handle more requests and traffic than ever before and build a better app. In upcoming versions, you will also be able to get Apigee's full Analytics and Debugging features to see API performance metrics, understand usage, view requests and responses and dig into errors.

Add-on Installation

To use (add-on) on Heroku, install the Apigee add-on:

$ heroku addons:add apigee

Local setup

Activating the add-on will create two private Twitter API endpoints for you as configvars. To use Apigee, simply make any normal request to api.twitter.com or search.twitter.com, but instead use the configvar APIGEE_TWITTER_API_ENDPOINT in place of api.twitter.com and APIGEE_TWITTER_SEARCH_API_ENDPOINT in place of search.twitter.com.

Using OAuth with Apigee

In order to use OAuth with Apigee, there are two important steps to keep in mind:

  1. All API requests are made through Apigee, except for the OAuth dance
  2. API requests must be signed as if they are going directly to Twitter (using http://api.twitter.com in the base string) but then sent through your Apigee endpoint.

After you activate the add-on, Apigee will create a private endpoint for your API requests. You can continue to request user tokens as you have before, and likewise, you would continue to build the base string with http://api.twitter.com . But instead of sending those requests directly to http://api.twitter.com , you instead send them to your configvar, e.g. http://APIGEE_TWITTER_API_ENDPOINT instead.

Note: several gems have been reported to support the use of proxies with the Twitter API:

A Note on Search

While Twitter's search methods at one time were available at api.twitter.com, those are no longer supported. Be sure to use the Apigee provided configvar for search to make all your search API requests.

Additional Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment