Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active September 15, 2016 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshouman/4cfd140bf9d00cd417c2e7c34370fee1 to your computer and use it in GitHub Desktop.
Save weshouman/4cfd140bf9d00cd417c2e7c34370fee1 to your computer and use it in GitHub Desktop.
Curl into the graph api

Acquiring an Access Token

First we need an access token with some permissions sufficient for the calls we are gonna make.
Let's just use the basic permissions about us.
To acquire an access token use this tool

GET reqeust

Following command should return {"name":user_name,"id":user_id}

curl -X GET "https://graph.facebook.com/me?access_token=ACCESS_TOKEN"

Following command gets the previous return explicitly

curl -X GET "https://graph.facebook.com/me?fields=id,name&access_token=ACCESS_TOKEN"

POST request

Following command should only return {"success": true}

curl -X POST https://graph.facebook.com/me -d "access_token=ACCESS_TOKEN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment