Page tree
Skip to end of metadata
Go to start of metadata

Query the Facebook Graph API to gather information on different categories of the user profile, e.g. the movies entered by the user or the liked pages.

To get a valid access token, go to https://developers.facebook.com/tools/explorer/ and request a token by logging in with your Facebook credentials. During the process you get to select the permissions associated with the token. Keep those in mind and make sure you only try to query data permitted by the token. The token generated with this tool will expire after one or two hours. To get more information on this refer to the facebook API documentation.


Datasource Type

REST Custom

Datasource Request Parameters
access_token
< token created at Facebook Graph API Explorer >
Datasource URLhttps://graph.facebook.com/v2.8/
Datasource Test URL
/me?fields=id
Query URL
/me/:category
Parameter valuese.g. "likes" or "movies"
Query JSON Path
$.data
Converter Example
function convert(json) {
    var result = [];
    var parsedJsonObject = JSON.parse(json);
    var current, index;
    for (index in parsedJsonObject) {
        if (parsedJsonObject.hasOwnProperty(index)) {
            current = parsedJsonObject[index];
            result.push({
                'Item Name': current.name,
                'Creation Date': PocketQuery.formatDate(current.created_time,'ddd, MMM Do YYYY, hh:mm')
            });
        }
    }
    return result;
}

 


  • No labels