GraphQuery

You can use the GraphQuery activity to query social graph.

General

Facebook social graph represents connections between Facebook objects such as users, links, and pages. You can use the GraphQuery activity to search for a specific object and its details. It does not return results across all Facebook objects and focuses on a single object. The GraphQuery requires the ID of the object you query.

The following table describes the configurations on the General tab of the GraphQuery activity.

Field Module Property? Visual diff? Description
Name No Yes

The name of the activity displayed in the process. The default value is GraphQuery.

Object No Yes One of the Facebook objects to be queried.
Query Edges (Connection) No Yes Select this check box to query edge or connections between objects.
Edge (Connection) No Yes Type of edge or connection to query. Edges are the connections, or relationships, between nodes, such as friendships between people, likes of pages, or the list of comments on a photo.

For example, if you select Post from the Object list, you can use the Edge (Connection) list to select Comments and Likes.

See the Facebook Developer Documentation for details.

Note the following considerations for Edge (Connection) Likes:
  • When object is Link and Edge (Connection) is Likes, you must use only the page access token.
  • When object is Post and Edge (Connection) is Likes, you must use the user access token. In the additional parameters, you must use reactions as a field. Example: fields=reactions
Note:
  • This field is displayed only when you select the Query Edges (Connection) check box.
  • Notifications for the Page object and tags for the Photo object are not supported.
Note:
  • For Graph Query Object Link and Edge (Connection) Likes, you can use only the page access token.
  • For Graph Query Object Post and Edge (Connection) Likes, along with user access token, you must use reactions as a field in the additional parameters. (For example: fields=reactions)

Description

On the Description tab, you can add a short description for the GraphQuery activity.

Input

The following table describes the input elements on the Input tab of the GraphQuery activity.

Input Item Data Type Description
graphObjectID String Run the process twice to retrieve information, with different values on the Input tab.
  1. Use your own user ID or the string "me", including the double quotation marks to retrieve the object you want to query. For example, if you want to query a friend's connections, you must get that friend's user ID.
  2. In the second GraphQuery activity, specify the ID of the object where you want to retrieve information.
maxNumOfPages Integer The maximum number of pages that is used to display retrieved records that the process performs. The default value is 1.

If you set it to -1, all the retrieved records that Facebook returns are displayed, regardless of the page size limit.

pageSize Integer Number of items displayed on one page. Default is 25.

If you specify -1 for maxNumOfPages, the value of pageSize is ignored.

recordOffset Long A number that is deducted from the retrieved records number.
Note: This field is displayed only when you select the Edge (Connection) check box from the General tab.
since String The start time of what you want to query.
until String The end time of what you want to query.
BuildInDelay Integer The minimum sleep time a process need to run the activity.
additionalParams String Additional parameters, depending on the selection you make on the General tab. For examples on additional parameters, refer to the Output section below.
token String The Facebook authentication token (OAuth token) to access the data.

Output

The returned object is displayed in the .xml format. The information available in the object depends on the object selected on the General tab and the permissions settings for that object. For example, if you select the object Link and the CollectionName Comments to get all comments on a link, the following are some of the sample fields which are included in the output.
  • id
  • metadata
  • type
  • from
  • message
  • createdTime
  • likes
Note: (Optional) You can enter one or multiple parameters in the additionalParams field to receive additional data in the output. Refer to the examples given below:
  • Object - User

    CollectionName - None

    Syntax (to be entered in the additionalParams field) - fields=birthday,email,first_name

    Output - This would retrieve the birthday, email and first name of the userid provided

  • Object - User

    CollectionName - Feed

    Syntax (to be entered in the additionalParams field) - fields= actions,message

    Output - This would retrieve actions like Share and Like on the user's feed, and also messages published on the user's feed

  • Object - Event

    Syntax (to be entered in the additionalParams field) - fields= description,start_time

    Output - This would retrieve the description entered for the event and the start time of the event

Fault

The following table describes the error schema elements on the Fault tab of the GraphQuery activity.

Output Item Data Type Description
FBPluginException
msg String This error message is displayed when the Facebook plug-in captures an exception.
msgCode String This error code is displayed when the Facebook plug-in captures an exception.
FBConnectionException
msg String This error message is displayed when the HTTP connection to Facebook is not available, or another connection problem that is unrelated to authorization exists.
msgCode String

This error code is displayed when the HTTP connection to Facebook is not available, or another connection problem that is unrelated to authorization exists.

FBOauthException
msg String This error message is displayed when your token is invalid, expires, or you have no permission to retrieve or publish the information you want to retrieve or publish.
msgCode String This error code is displayed when your token is invalid, expires, or you have no permission to retrieve or publish the information you want to retrieve or publish.