Recently I had the opportunity of Integrating Social Media Apps with Some of Our Products.Below are some Important Observations.
•All social media network APIs provide simple HTTP POST-based API’s to post messages/photos.
•The integration is highly secure because posting on social sites is done via Oauth Protocol, which relies on an access token rather than user name and password. Facebook and Foursquare support Oauth 2.0 and Twitter supports Oauth 1.0.
•The API access has the right to perform all operations which a Facebook, Twitter or Foursquare user would have as long as the user has appropriate permissions. Permissions can be given at a granular level; hence customers can restrict access to the posting component.
•The response from all of the API’s are in JSON format. The Open Source JSON parsing API was used for marshalling and unmarshalling data records.
•Each object in the social media data is associated with a unique id. This unique id changes over time. For example, the profile id for a specific user can vary per session. Search API’s for each site were used to fetch the correct profile/object id prior to posting any message(s).
•Oauth 2.0 Protocol not supported on Twitter,Extra code needs to be written to generate authorization header every time any request is sent to Twitter.Twitter Integration because of Older OAuth Protocol is cumbersome.
•APIs for posting messages are not consistent. Facebook and Foursquare use HttpClient. The post to Twitter is based on urlconnection-based posting. Oauth 1.0 Twitter posting using HttpClient needs to be explored.
Source Code
The API is written in java and uses Commons HttpClient for Posting Request to Social Media API's
Source Code
What is OAuth Dance?
How to Get Auth Token:
How to Get Auth Facebook
How to get Auth Token for Foursquare:
App Developer Doc
Twitter
Facebook
Foursquare
Recommended Library:
Twitter4J for Twitter. It is recommended to use this API for Twitter since generation of Auth Header using HttpClient is still a tedious task in twitter now since it is still on OAuth 1.0.
Facebook and Foursquare have already moved to OAUTH 2.0 making the process of generating Security Headers less difficult.
Wednesday, May 4, 2011
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment