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.
Operation | Description |
---|---|
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.
<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.
{ "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 init
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.
<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)"/> <gmailRest.getAccessTokenFromRefreshToken> <refreshToken>{$ctx:refreshToken}</refreshToken> <clientId>{$ctx:clientId}</clientId> <clientSecret>{$ctx:clientSecret}</clientSecret> <grantType>{$ctx:grantType}</grantType> </gmailRest.getAccessTokenFromRefreshToken> <gmail.gmailinit> <apiUrl>{$ctx:apiUrl}</apiUrl> <access_token>{$ctx:access_token}</access_token> <userId>{$ctx:userId}</userId> <apiVersion>{$ctx:apiVersion}</apiVersion> </gmail.gmailinit> <gmail.listTheHistory> <startHistoryId>{$ctx:startHistoryId}</startHistoryId> <labelId>{$ctx:labelId}</labelId> <maxResults>{$ctx:maxResults}</maxResults> <pageToken>{$ctx:pageToken}</pageToken> </gmail.listTheHistory> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <parameter name="serviceType">proxy</parameter> <description/> </proxy>