This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Friend Lists in Facebook
Overview
The following operation allows you to work with friend lists. Click the operation name to see details on how to use it.Â
For a sample proxy service that illustrates how to work with the friend lists, see Sample configuration.
Operation | Description |
---|---|
getFriendListDetails | Returns the friend list details. |
Operation details
This section provides details on the operation.
Retrieving a friend list
The getFriendListDetails
 operation returns details of a specified friend list.Â
<facebook.getFriendListDetails> <friendListId>{$ctx:friendListId}</friendListId> <fields>{$ctx:fields}</fields> </facebook.getFriendListDetails>Â
 Properties
friendlistId
: The friend list ID to retrieve details.fields
:Â The fields that you want to retrieve. For more information on thefields
property, see https://developers.facebook.com/docs/graph-api/reference/friendlist#fields.
Sample request
Following is a sample REST request that can be handled by the getFriendListDetails
operation.
{ "apiUrl":"https://graph.facebook.com", "apiVersion":"v2.4", "accessToken":"CAACEdEose0cBAGSdZAM57plxhqKFvPJ8ZCfk2PW0siLl50ByGVcqzUKXcZCl8qPhrh5Q3YXdXCfDUGoZAQyg8cDMS7CooEtkmEMjFp2LeH9HqRZCBGZCOhEWYv7AbBKUikPzSt3QxFfwsVCFSa2UFZBq1fMoDW0CxRdHIZC0BAzhbuIFZCo89XUJ2iPZBAwu2ZBjQAVxYEB9tYsnwZDZD", "friendlistId":"10150522598658814" }
Related Facebook documentation:Â
https://developers.facebook.com/docs/graph-api/reference/friendlist#readÂ
Sample configuration
Following is a sample proxy service that illustrates how to connect to Facebook with the init
 operation, and then use the getFriendListDetails
 operation. The sample request for this proxy can be found in the getFriendListDetails
 sample request.
As a best practice, create a separate sequence to handle response payload errors. In the following sample, the sequence that handles errors is the faultHandlerSeq
.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="facebook_getFriendListDetails" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="friendlistId" expression="json-eval($.friendlistId)"/> <property name="fields" expression="json-eval($.fields)"/> <facebook.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$ctx:apiVersion}</apiVersion> </facebook.init> <facebook.getFriendListDetails> <friendListId>{$ctx:friendListId}</friendListId> <fields>{$ctx:fields}</fields> </facebook.getFriendListDetails> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>
Â