/
Working with People/Profiles

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 People/Profiles



Overview

The following operations allow you to work with people/profiles. Click an operation name to see details on how to use it. For sample proxy service which illustrates how to deal with activities, see   Sample configuration .

OperationDescription
getPeople
Gets the google plus profile according to the user id.
searchPeople Search all public profiles according to a given query.
listPeople

List all of the people in the specified collection.

listByActivityList all of the people in the specified collection for a particular activity.

Operation Details

This section provides further details on the operations related to people/profiles.

Retrieving People    

The getPeople operation is used to get a person's profile to user Id..

getPeople
<GooglePlus.getPeople>
	<userId>{$ctx:userId}</userId>
	<fields>{$ctx:fields}</fields>
</GooglePlus.getPeople>
Properties
  • userId - Required - The google plus user ID

  • fields - Fields in response (If null all the fields will in response)

Sample request

Following is a sample request that can be handled by the getPeople operation.

Sample Request for getPeople
{
"userId":"114143056275520026644",
"fields":"aboutMe,ageRange,birthday,circledByCount,cover,emails,gender,image,kind,name"
}
Related API documentation

https://developers.google.com/+/api/latest/people/get

Searching a user profile

The searchPeople operation is used  to search all public profiles.

searchPeople
<GooglePlus.searchPeople>
	<query>{$ctx:query}</query>
	<fields>{$ctx:fields}</fields>
	<maxResults>{$ctx:maxResults}</maxResults>
	<pageToken>{$ctx:pageToken}</pageToken>
	<language>{$ctx:language}</language>
</GooglePlus.searchPeople>
Properties 
  • query - Required - Specify a query string for full text search of public text in all profiles.

  • fields - Fields in response (If null all the fields will in response)

  • maxResults - The maximum number of people to include in the response, which is used for paging.

  • pageToken - The continuation token, which is used to page through large result sets.

  • language - Specify the preferred language to search with.

 Sample request

Following is a sample request that can be handled by the searchPeople operation.

Sample Request for searchPeople
{
"query":"wso2",
"language":"en-US",
"maxResults":"10",
"pageToken":"EBkaAA",
"fields":"etag,kind"
}
Related API documentation

https://developers.google.com/+/api/latest/people/search

Listing people

The listPeople operation is used to retrieve the people in specified collection.

listPeople
<GooglePlus.listPeople>
	<userId>{$ctx:userId}</userId>
	<collection>{$ctx:collection}</collection>
	<fields>{$ctx:fields}</fields>
	<pageToken>{$ctx:pageToken}</pageToken>
	<maxResults>{$ctx:maxResults}</maxResults>
	<orderBy>{$ctx:orderBy}</orderBy>
</GooglePlus.listPeople>
Properties   
  • userId : Required - The google+ user ID

  • collection : Required - The collection of moments to list. (string)

  • fields - Fields in response (If null all the fields will in response)

  • pageToken - The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.

  • maxResults - Number of results in response (If null max of 20 results will in response)

  • orderBy - The order to return people in.

Sample request

Following is a sample request that can be handled by the listPeople operation.

Sample Request for listPeople
{
"userId":"me",
"collection":"visible",
"maxResults":"10",
"orderBy":"alphabetical",
"pageToken":"CAoQ8MmEz4Up",
"fields":"etag,items(aboutMe,ageRange,birthday,currentLocation,displayName,domain,emails,etag,gender,id,image,isPlusUser,kind,language,name,nickname,objectType,occupation,organizations,placesLived,plusOneCount,relationshipStatus,skills,tagline,url,urls,verified),kind,nextPageToken,selfLink,title,totalItems"
}
Related API documentation

https://developers.google.com/+/api/latest/people/list

List people by activity    

The listByActivity operation is used to people in the specified collection for a particular activity.

listByActivity
<GooglePlus.listByActivity>
	<activityId>{$ctx:activityId}</activityId>
	<collection>{$ctx:collection}</collection>
	<fields>{$ctx:fields}</fields>
	<pageToken>{$ctx:pageToken}</pageToken>
	<maxResults>{$ctx:maxResults}</maxResults>
</GooglePlus.listByActivity>
Properties
  • activityId : Required - The google plus activity ID

  • collection : Required - The collection of moments to list. (string)

  • fields - Fields in response (If null all the fields will in response)

  • pageToken - The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.

  • maxResults - Number of results in response (If null max of 20 results will in response)

Sample request

Following is a sample request that can be handled by the listByActivity operation.

Sample Request for listByActivity
{
"activityId":"z12ksnbbesipc3xlh22qsnhguuqhhptza04",
"collection":"plusoners",
"maxResults":"5",
"pageToken":"KmkKO_f5yQRg_jRcBJielp7Fz8_Pz8_Py8iZys3HmsebysXMyMXMyN7Oz83HyM3Ny8rJx8vPycrMysjPzv_-EAUhMiE_k3gxOCExvXAqP9DJyR05-6PLAZ_7NgZQAFoLCRIA2k7XIitAEAEyDQoLCgAo-dv8hvPawAI",
"fields":"etag,items(aboutMe,emails,gender,isPlusUser,kind,name),kind,nextPageToken,selfLink,title,totalItems"
}
Related API documentation

https://developers.google.com/+/api/latest/people/listByActivity

Sample configuration

Following is a sample proxy service that illustrates how to connect to Nimble and use the listByActivity operation. The sample request for this proxy can be found in Sample Request for listByActivity. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="searchActivities"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="query"
                      expression="json-eval($.query)"
                      scope="default"
                      type="STRING"/>
            <property name="fields"
                      expression="json-eval($.fields)"
                      scope="default"
                      type="STRING"/>
            <property name="maxResults"
                      expression="json-eval($.maxResults)"
                      scope="default"
                      type="STRING"/>
            <property name="pageToken"
                      expression="json-eval($.pageToken)"
                      scope="default"
                      type="STRING"/>
            <property name="orderBy"
                      expression="json-eval($.orderBy)"
                      scope="default"
                      type="STRING"/>
            <property name="language"
                      expression="json-eval($.language)"
                      scope="default"
                      type="STRING"/>
            <googleplus.getAccessToken>
                <clientId>9689637606-sf1r4lqgpvkicmtt8b4mbdclvu1idvb4.apps.googleusercontent.com</clientId>
                <clientSecret>iyGMX1PbmJSXNpz4H0l7jKsN</clientSecret>
                <refreshToken>1/l34RBaPc8oLEiiwvil1xMZcQpeeZpNUithgh2x9oPko</refreshToken>
                <grantType>refresh_token</grantType>
            </googleplus.getAccessToken>
            <googleplus.searchActivities>
                <query>{$ctx:query}</query>
                <fields>{$ctx:fields}</fields>
                <maxResults>{$ctx:maxResults}</maxResults>
                <pageToken>{$ctx:pageToken}</pageToken>
                <orderBy>{$ctx:orderBy}</orderBy>
                <language>{$ctx:language}</language>
            </googleplus.searchActivities>
            <respond/>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>

Related content