Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Facebook Open Graph API and How To Use It

This presentation was made for "Facebook Dev Meetup Kathmandu" held on 3rd April, 2016.
In this presentation, we talk about Facebook's Social Graph, Facebook Open Graph v2.5 and How we can use the api to build our apps. We explore the Graph API using Facebook's Graph API Explorer.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

Facebook Open Graph API and How To Use It

  1. 1. OPEN GRAPH API AND HOW TO USE IT. FACEBOOK DEVELOPERS MEETUP
  2. 2. AAYUSH SHRESTHA FIND ME AT : FB.COM/SHRESTHAAAYUSH @AAYUSHSHRESTHA AAYUSHONWEB@GMAIL.COM HEAD OF EXPERIENCE DESIGN AND ARCHITECTURE - VIVEKA HEALTH CO-FOUNDER - LISHN.COM
  3. 3. INTRODUCTION GRAPH API ▸ Primary way for apps to get data in and out of the 
 Facebook Social Graph ▸ HTTP Based REST API ▸ You can : ▸ query data ▸ post status and stories ▸ upload pictures and videos and more … ▸ V2.5
  4. 4. INTRODUCTION SOCIAL GRAPH ▸ Representation of the information on Facebook ▸ NODES ▸ EDGES ▸ FIELDS
  5. 5. INTRODUCTION SOCIAL GRAPH - NODES ▸ Every “thing”, such as a user, a photo, a comment, a page is a node. ▸ User ▸ Photo ▸ Album ▸ Event ▸ Group ▸ Page ▸ Comment ▸ Story ▸ Video ▸ Link ▸ Note
  6. 6. INTRODUCTION SOCIAL GRAPH - EDGES ▸ The connection between these “things” are edges. ▸ Feed ▸ Tagged ▸ Posts ▸ Picture ▸ Friends ▸ Activities ▸ Interests ▸ Likes ▸ Photos ▸ Statuses
  7. 7. ▸ The information about these “things” are fields. ▸ User has : name, age, birthday, etc. ▸ Page has : name, description, category, etc INTRODUCTION SOCIAL GRAPH - FIELDS
  8. 8. LETS USE GRAPH API!!
  9. 9. BUT, HOLD ON!
  10. 10. LET’S USE GRAPH API BEFORE JUMPING IN ▸ Making Graph API calls require an Access Token ▸ Get your Access Token using Facebook Login or one of the SDK’s ▸ Get familiar with the Graph API Explorer
 http://developers.facebook.com/tools/explorer
  11. 11. LET’S USE GRAPH API TRAVERSING THROUGH THE GRAPH ▸ Authentication : OAuth 2.0 ▸ Selection (or Query) ▸ Basic Operations (Publishing, Updating and Deleting) ▸ Searching ▸ Introspection
  12. 12. LET’S USE GRAPH API SELECTION - SELECTING NODES ▸ graph.facebook.com/{node_id} ▸ graph.facebook.com/{node_username} ▸ graph.facebook.com/{node_id}?fields=id,name ▸ TRY THESE 1./me?field=id,name 2./me?field=album.limit(10){name,likes,count},photos 3./album_id 4./page_id
  13. 13. LET’S USE GRAPH API SELECTION - SELECTING CONNECTIONS ▸ graph.facebook.com/{node_id}?fields={connection_name} ▸ graph.facebook.com/{node_id}/{connection_name} ▸ graph.facebook.com/{node_id}/{connection_name}? fields=id,name ▸ TRY THESE 1./me/friends 2./me/friends/friend_id 3./albums 4./photos?type=uploaded
  14. 14. LET’S USE GRAPH API PUBLISHING ▸ Publishing is done in edges ▸ graph.facebook.com/{node_id}/{connection_name} - POST Request ▸ TRY THESE 1./me/feed - Fields : message=Hello World! 2./me/feed - Fields : message=Hello World!, privacy = {value : ‘SELF’}
  15. 15. LET’S USE GRAPH API UPDATING ▸ Make POST Requests, now on nodes ▸ graph.facebook.com/{node_id} - POST Request ▸ TRY THESE 1. /{node_id} - Fields : message=Hello World Again!!
  16. 16. LET’S USE GRAPH API DELETING ▸ Make DELETE Request on the node ▸ graph.facebook.com/{node_id} - DELETE Request ▸ TRY THESE 1./{story_id}
  17. 17. LET’S USE GRAPH API SEARCHING ▸ graph.facebook.com/search ▸ TRY THESE 1./search?q=john&type=user 2./search?q=facebook+meetup&type=event 3./search?q=coffee&type=place&center={lat},{lon}&distance=1000
  18. 18. LET’S USE GRAPH API INTROSPECTION ▸ graph.facebook.com/{node_id}?metadata=1 ▸ JSON comes with the metadata of the node ▸ What type of node is this? ▸ What are its fields and what do they represent? ▸ What connections does this node possess? ▸ TRY THESE 1./me?metadata=1
  19. 19. ADVANCED STUFF OPEN GRAPH STORIES
  20. 20. THANK YOU!! FIND ME AT : FB.COM/SHRESTHAAAYUSH @AAYUSHSHRESTHA AAYUSHONWEB@GMAIL.COM

    Be the first to comment

    Login to see the comments

  • takeshi_miao

    Aug. 2, 2016

This presentation was made for "Facebook Dev Meetup Kathmandu" held on 3rd April, 2016. In this presentation, we talk about Facebook's Social Graph, Facebook Open Graph v2.5 and How we can use the api to build our apps. We explore the Graph API using Facebook's Graph API Explorer.

Views

Total views

2,828

On Slideshare

0

From embeds

0

Number of embeds

16

Actions

Downloads

103

Shares

0

Comments

0

Likes

1

×