Skip to main content
Skip table of contents

Facebook Graph API

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

CODE
access_token

Datasource URL

https://graph.facebook.com/v2.8/

Datasource Test URL

CODE
/me?fields=id

Query URL

CODE
/me/:category

Parameter values

e.g. "likes" or "movies"

Converter Example

CODE
function convert(json) {
    var result = [];
    var parsedJsonObject = JSON.parse(json);
    var current, index;
    for (index in parsedJsonObject.data) {
        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;
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.