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/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Overview

The following operations allow you to work with User profile. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with user history, see Sample configuration.

OperationDescription

listTheHistory

list the user history

Operation details

This section provides further details on the operations related to user history.

List down the user history

The  listTheHistory  operation lists all user history.

listTheHistory
<gmailRest.listTheHistory>
	<startHistoryId>{$ctx:startHistoryId}</startHistoryId>
    <labelId>{$ctx:labelId}</labelId>
    <maxResults>{$ctx:maxResults}</maxResults>
    <pageToken>{$ctx:pageToken}</pageToken>
</gmailRest.listTheHistory>
Properties
  • startHistoryId: Returns history records after the specified startHistoryId.
  • labelId: Only return messages with a label matching the ID.
  • maxResults: The maximum number of history records to return.
  • pageToken: Page token to retrieve a specific page of results in the list.
Sample request

Following is a sample REST/JSON request that can be handled by the  listTheHistory  operation.

Sample Request for listTheHistory
{  
  "startHistoryId":"7399652",
  "labelId":"Label_31",
  "maxResults":"10"
}
Related Gmail documentation

https://developers.google.com/gmail/api/v1/reference/users/history/list

Sample configuration

Following is a sample proxy service that illustrates how to connect to Gmail with the gmailRestInit operation and use the  listTheHistory  operation. The sample request for this proxy can be found in listTheHistory sample request. 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="gmail_listTheHistory"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="startHistoryId" expression="json-eval($.startHistoryId)"/>
            <property name="labelId" expression="json-eval($.labelId)"/>
            <property name="maxResults" expression="json-eval($.maxResults)"/>
            <property name="pageToken" expression="json-eval($.pageToken)"/>
            <property name="userId" expression="json-eval($.userId)"/>
            <property name="refreshToken" expression="json-eval($.refreshToken)"/>
            <property name="clientId" expression="json-eval($.clientId)"/>
            <property name="clientSecret" expression="json-eval($.clientSecret)"/>
            <property name="accessToken" expression="json-eval($.accessToken)"/>
            <property name="registryPath" expression="json-eval($.registryPath)"/>
            <property name="apiUrl" expression="json-eval($.apiUrl)"/>
            <gmailRest.gmailRestInit>
                <userId>{$ctx:userId}</userId>
                <refreshToken>{$ctx:refreshToken}</refreshToken>
                <clientSecret>{$ctx:clientSecret}</clientSecret>
                <clientId>{$ctx:clientId}</clientId>
                <registryPath>{$ctx:registryPath}</registryPath>
                <accessToken>{$ctx:accessToken}</accessToken>
                <apiUrl>{$ctx:apiUrl}</apiUrl>
            </gmailRest.gmailRestInit>
            <gmailRest.listTheHistory>
                <startHistoryId>{$ctx:startHistoryId}</startHistoryId>
                <labelId>{$ctx:labelId}</labelId>
                <maxResults>{$ctx:maxResults}</maxResults>
                <pageToken>{$ctx:pageToken}</pageToken>
            </gmailRest.listTheHistory>
            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
    </target>
    <parameter name="serviceType">proxy</parameter>
    <description/>
</proxy>
  • No labels