SlideShare a Scribd company logo
OPEN GRAPH API
AND HOW TO USE IT.
FACEBOOK DEVELOPERS MEETUP
AAYUSH SHRESTHA
FIND ME AT :
FB.COM/SHRESTHAAAYUSH
@AAYUSHSHRESTHA
AAYUSHONWEB@GMAIL.COM
UI/UX DEVELOPER - VIVEKA HEALTH
CO-FOUNDER - LISHN
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.8
INTRODUCTION
SOCIAL GRAPH
▸ Representation of the information on Facebook
▸ NODES
▸ EDGES
▸ FIELDS
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
INTRODUCTION
SOCIAL GRAPH - EDGES
▸ The connection between these “things” are edges.
▸ Feed
▸ Tagged
▸ Posts
▸ Picture
▸ Friends
▸ Activities
▸ Interests
▸ Likes
▸ Photos
▸ Statuses
▸ The information about these “things” are fields.
▸ User has : name, age, birthday, etc.
▸ Page has : name, description, category, etc
INTRODUCTION
SOCIAL GRAPH - FIELDS
LETS USE GRAPH API!!
BUT, HOLD ON!
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
LET’S USE GRAPH API
TRAVERSING THROUGH THE GRAPH
▸ Authentication : OAuth 2.0
▸ Selection (or Query)
▸ Basic Operations (Publishing, Updating and Deleting)
▸ Searching
▸ Introspection
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
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
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’}
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!!
LET’S USE GRAPH API
DELETING
▸ Make DELETE Request on the node
▸ graph.facebook.com/{node_id} - DELETE Request
▸ TRY THESE
1./{story_id}
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
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
ADVANCED STUFF
OPEN GRAPH STORIES
OPEN GRAPH STORIES
OPEN GRAPH STORIES
▸ Rich, Structured Posts
▸ Strongly Typed API
▸ Implemented using
▸ Web SDK (JS)
▸ Android SDK
▸ iOS SDK
OPEN GRAPH STORIES
KEY CONCEPTS
▸ Actor : The person who posts the story
▸ App : The app that created the story
▸ Action : Activity the Actor performs (Verb)
▸ Object : The thing that the Actor interacts with
OPEN GRAPH STORIES
KEY CONCEPTS - ACTOR
OPEN GRAPH STORIES
KEY CONCEPTS - APP
OPEN GRAPH STORIES
KEY CONCEPTS - ACTION
OPEN GRAPH STORIES
KEY CONCEPTS - OBJECT
OPEN GRAPH STORIES
OPEN GRAPH STORIES ON WEB
▸ Create Facebook App ID
▸ Configure your web App
▸ You should have access to a public web server
OPEN GRAPH STORIES
OPEN GRAPH STORIES : ACTIONS
▸ Actions are verbs in stories
▸ Created using Graph API. e.g. to create a “like” action, we use
og.likes API Endpoint
FB.api({
'https://graph.facebook.com/me/og.likes',
'post',
{
object: obj,
privacy: {'value': 'SELF'}
},
})
OPEN GRAPH STORIES
OPEN GRAPH STORIES - ACTIONS
▸ Some Actions that are available to use
▸ og.likes
▸ og.follows
▸ save.saves
▸ book.reads
▸ book.rates
▸ games.achieves
▸ games.plays
▸ music.listens
▸ music.playlists
OPEN GRAPH STORIES
OPEN GRAPH STORIES : OBJECTS
▸ Created by adding meta tags on the page where your
content is.
<meta property="fb:app_id" content="148285558994270" />
<meta property="og:type" content="book" />
<meta property="og:url" content="https://aayushshrestha.github.io/AayushShrestha/
mynewbook.html" />
<meta property="og:title" content="I Like Cats" />
<meta property="og:image" content="http://www.rd.com/wp-content/uploads/sites/2/2016/04/01-cat-
wants-to-tell-you-laptop.jpg" />
<meta property="og:description" content="I Like Cats" />
OPEN GRAPH STORIES
OPEN GRAPH STORIES - OBJECTS
▸ Some Objects that are available to use
▸ article
▸ books.book
▸ books.author
▸ fitness.course
▸ game.achievement
▸ music.album
▸ music.song
▸ music.playlist
▸ place
▸ product
▸ restaurant.menu
THANK YOU!!
FIND ME AT :
FB.COM/SHRESTHAAAYUSH
@AAYUSHSHRESTHA
AAYUSHONWEB@GMAIL.COM

More Related Content

PDF
Facebook Open Graph API and How To Use It
PDF
Facebook Platform for Developers
PPTX
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
PPTX
android deep linking
PPTX
Design Portfolio
PDF
How can you amplify your blog to reach maximum users
PPT
Social Media Tools: ETC 2009
ODP
Jetpack 2.0
Facebook Open Graph API and How To Use It
Facebook Platform for Developers
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
android deep linking
Design Portfolio
How can you amplify your blog to reach maximum users
Social Media Tools: ETC 2009
Jetpack 2.0

What's hot (18)

DOCX
Social Media for Investigations Tools
PDF
Social media fundraising
PDF
Conjuregram Review Ben Murray & Daniel Adetunji
PDF
Google Plus Pages for Brands and Businesses: What Now? What Next? - webinar
PPTX
How to connect social media with open standards
PPTX
How I built the demo's
PDF
Have fun with your photos using some of these photosharing sites
PPTX
Re-using social media data
PPT
Mapping images the digital way
PPTX
Google 2.0
PPTX
Twitter Basics for Business
PPTX
Blogs for Librarians - Karen du Toit
PPTX
The page and the desktop
PPTX
Microformats and SEO
PDF
Social Media Reference Link (@JuliusDesign)
PPT
Blog and search
PPT
Blending Social Media in WordPress
PPTX
5 Time Saving Social Media Tips
Social Media for Investigations Tools
Social media fundraising
Conjuregram Review Ben Murray & Daniel Adetunji
Google Plus Pages for Brands and Businesses: What Now? What Next? - webinar
How to connect social media with open standards
How I built the demo's
Have fun with your photos using some of these photosharing sites
Re-using social media data
Mapping images the digital way
Google 2.0
Twitter Basics for Business
Blogs for Librarians - Karen du Toit
The page and the desktop
Microformats and SEO
Social Media Reference Link (@JuliusDesign)
Blog and search
Blending Social Media in WordPress
5 Time Saving Social Media Tips
Ad

Similar to Open Graph API And How To Use It : Facebook Developers Circle Meetup 2017 (20)

PDF
How to Setup App Indexation
PDF
Facebook Apps: Ein Entwicklungsleitfaden - WMMRN
PDF
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
PDF
Bear Douglas - Open Graph Montreal
PPTX
Programming Social Applications
PDF
Sunnyside Up: Facebook Mobile, Follow, and Like Updates and Google +1 Updates
PDF
Introduction to Web APIs and the Google+ API - BarCamp Phnom Penh 2011
KEY
Google+ platform (9-15-2011)
PPTX
Shiny Agency's Facebook Development Guidelines
PDF
Facebook Open Graph Tech Requirements
PDF
Django User Management & Social Authentication
PPTX
Optimizing WordPress sites for SEO and social media by Miriam Schwab
PDF
Introduction to OpenSocial
PPTX
The Flash Facebook Cookbook - FlashMidlands
PPT
Hi5 Open Social
PDF
Meteor.js for DOers
PPT
What's New on the Facebook Platform, July 2011
PPT
Simple Social Networking with Ruby on Rails
PPT
Iskandar Najmuddin
PPT
Build Facebook Connect enabled applications with Google Apps Engine
How to Setup App Indexation
Facebook Apps: Ein Entwicklungsleitfaden - WMMRN
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
Bear Douglas - Open Graph Montreal
Programming Social Applications
Sunnyside Up: Facebook Mobile, Follow, and Like Updates and Google +1 Updates
Introduction to Web APIs and the Google+ API - BarCamp Phnom Penh 2011
Google+ platform (9-15-2011)
Shiny Agency's Facebook Development Guidelines
Facebook Open Graph Tech Requirements
Django User Management & Social Authentication
Optimizing WordPress sites for SEO and social media by Miriam Schwab
Introduction to OpenSocial
The Flash Facebook Cookbook - FlashMidlands
Hi5 Open Social
Meteor.js for DOers
What's New on the Facebook Platform, July 2011
Simple Social Networking with Ruby on Rails
Iskandar Najmuddin
Build Facebook Connect enabled applications with Google Apps Engine
Ad

More from Aayush Shrestha (8)

PPTX
Design and UX. An Introduction
PPTX
Workshop on Hybrid App Development with Ionic Framework
PPTX
Power of Elastic Search - nLocate
PPTX
JavaScript : What is it really? AND Some new features in ES6
PPTX
Understanding angular js
PPTX
A Half Day Workshop on Building Accessible Websites For People With Disabilities
PPTX
XBRL Implementation for Financial Reporting | NCASA
PPTX
XBRL Implementation for Financial Reporting
Design and UX. An Introduction
Workshop on Hybrid App Development with Ionic Framework
Power of Elastic Search - nLocate
JavaScript : What is it really? AND Some new features in ES6
Understanding angular js
A Half Day Workshop on Building Accessible Websites For People With Disabilities
XBRL Implementation for Financial Reporting | NCASA
XBRL Implementation for Financial Reporting

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
The AUB Centre for AI in Media Proposal.docx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

Open Graph API And How To Use It : Facebook Developers Circle Meetup 2017

  • 1. OPEN GRAPH API AND HOW TO USE IT. FACEBOOK DEVELOPERS MEETUP
  • 2. AAYUSH SHRESTHA FIND ME AT : FB.COM/SHRESTHAAAYUSH @AAYUSHSHRESTHA AAYUSHONWEB@GMAIL.COM UI/UX DEVELOPER - VIVEKA HEALTH CO-FOUNDER - LISHN
  • 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.8
  • 4. INTRODUCTION SOCIAL GRAPH ▸ Representation of the information on Facebook ▸ NODES ▸ EDGES ▸ FIELDS
  • 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. INTRODUCTION SOCIAL GRAPH - EDGES ▸ The connection between these “things” are edges. ▸ Feed ▸ Tagged ▸ Posts ▸ Picture ▸ Friends ▸ Activities ▸ Interests ▸ Likes ▸ Photos ▸ Statuses
  • 7. ▸ The information about these “things” are fields. ▸ User has : name, age, birthday, etc. ▸ Page has : name, description, category, etc INTRODUCTION SOCIAL GRAPH - FIELDS
  • 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. 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. 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. 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. 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. 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. 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. 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. 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
  • 20. OPEN GRAPH STORIES OPEN GRAPH STORIES ▸ Rich, Structured Posts ▸ Strongly Typed API ▸ Implemented using ▸ Web SDK (JS) ▸ Android SDK ▸ iOS SDK
  • 21. OPEN GRAPH STORIES KEY CONCEPTS ▸ Actor : The person who posts the story ▸ App : The app that created the story ▸ Action : Activity the Actor performs (Verb) ▸ Object : The thing that the Actor interacts with
  • 22. OPEN GRAPH STORIES KEY CONCEPTS - ACTOR
  • 23. OPEN GRAPH STORIES KEY CONCEPTS - APP
  • 24. OPEN GRAPH STORIES KEY CONCEPTS - ACTION
  • 25. OPEN GRAPH STORIES KEY CONCEPTS - OBJECT
  • 26. OPEN GRAPH STORIES OPEN GRAPH STORIES ON WEB ▸ Create Facebook App ID ▸ Configure your web App ▸ You should have access to a public web server
  • 27. OPEN GRAPH STORIES OPEN GRAPH STORIES : ACTIONS ▸ Actions are verbs in stories ▸ Created using Graph API. e.g. to create a “like” action, we use og.likes API Endpoint FB.api({ 'https://graph.facebook.com/me/og.likes', 'post', { object: obj, privacy: {'value': 'SELF'} }, })
  • 28. OPEN GRAPH STORIES OPEN GRAPH STORIES - ACTIONS ▸ Some Actions that are available to use ▸ og.likes ▸ og.follows ▸ save.saves ▸ book.reads ▸ book.rates ▸ games.achieves ▸ games.plays ▸ music.listens ▸ music.playlists
  • 29. OPEN GRAPH STORIES OPEN GRAPH STORIES : OBJECTS ▸ Created by adding meta tags on the page where your content is. <meta property="fb:app_id" content="148285558994270" /> <meta property="og:type" content="book" /> <meta property="og:url" content="https://aayushshrestha.github.io/AayushShrestha/ mynewbook.html" /> <meta property="og:title" content="I Like Cats" /> <meta property="og:image" content="http://www.rd.com/wp-content/uploads/sites/2/2016/04/01-cat- wants-to-tell-you-laptop.jpg" /> <meta property="og:description" content="I Like Cats" />
  • 30. OPEN GRAPH STORIES OPEN GRAPH STORIES - OBJECTS ▸ Some Objects that are available to use ▸ article ▸ books.book ▸ books.author ▸ fitness.course ▸ game.achievement ▸ music.album ▸ music.song ▸ music.playlist ▸ place ▸ product ▸ restaurant.menu
  • 31. THANK YOU!! FIND ME AT : FB.COM/SHRESTHAAAYUSH @AAYUSHSHRESTHA AAYUSHONWEB@GMAIL.COM