Last active
July 3, 2017 11:27
-
-
Save shabin-slr/fc787ca071381e577620d405787f6e1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Base URL : "https://graph.facebook.com/v2.9" | |
1. Login API | |
GET "/dialog/oauth?client_id=<CLIENT ID>&redirect_uri=<REDIRECT URI>&scope=<COMMA SEPERATED SCOPES eg public_profile>"; | |
RESPONSE "GET REQUEST ON CALLBACK URL WITH QUERY PARAM 'CODE' " | |
2. Get access_token for user with 'CODE' parameter | |
GET "/oauth/access_token?client_id=<CLIENT ID>&redirect_uri=<REDIRECT URI SAME AS ABOVE>&client_secret=<CLIENT SECRET>&code=<CODE RECEIVED IN EARLIER STEP>" | |
RESPONSE "JSON object containing access_token" | |
3.Get list of pages of a user | |
GET "/me/accounts?access_token=<access_token>&fields=id,created_time,message,from,to,tags,attachments" | |
RESPONSE "List of pages the user belongs to with following information : page name, id, category, the user's permissions on that page, page_access_token" | |
4. Connect page to Facebook app's WEBHOOK | |
POST "/{page_id}/subscribed_apps?access_token=<page_access_token of the page to connect>" | |
5. Read messages in a conversation | |
GET "/{conversation_id}/messages?access_token={page_access_token}&fields=id,created_time,message,from,to,tags,attachments" | |
RESPONSE "Array of messages" | |
6. Post message in conversation : | |
POST "/{conversation_id}/messages?access_token=<page_access_token>" | |
Request body : { "message" : "Message to send"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment