Overview
The following operations allow you to work with settings. Click an operation name to see details on how to use it.
Operation | Description |
---|---|
getSettings | Returns a single user setting. |
listSettings | Returns all user settings for the authenticated user. |
For a sample proxy service that illustrates how to work with settings resources, see Sample configuration.
Operation details
Following is more information about each of the operations.
Get Settings
To get settings, use googlecalendar.getSettings and specify the relevant properties.
<googlecalendar.getSettings> <setting>{$ctx:setting}</setting> </googlecalendar.getSettings>
Properties
setting : The id of the user setting.
Sample request
Following is a sample REST request that can be handled by the getSettings
operation.
{ "apiUrl":"%s(apiUrl)", "accessToken": "%s(accessToken)", "setting": "%s(setting)" }
List Settings
To list settings, use googlecalendar.listSettings and specify the relevant properties.
<googlecalendar.listSettings> <maxResults>{$ctx:maxResults}</maxResults> <pageToken>{$ctx:pageToken}</pageToken> <syncToken>{$ctx:syncToken}</syncToken> </googlecalendar.listSettings>
Properties
maxResults : optional- Maximum number of entries returned on one result page.
pageToken : optional- Token specifying which result page to return.
syncToken : optional- Token obtained from the nextSyncToken field returned on the last page of results from the previous list request.
Sample request
Following is a sample REST request that can be handled by the listSettings
operation.
{ "apiUrl":"%s(apiUrl)", "accessToken": "%s(accessToken)" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to Google Calendar with the init
operation as well as how to use the listSettings
operation to list all settings.
To view the sample request for this proxy, see sample request for the listSetting operation. You can use this sample as a template for using other operations in this category.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="googlecalendar_createListSettings" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="maxResults" expression="json-eval($.maxResults)"/> <property name="pageToken" expression="json-eval($.pageToken)"/> <property name="syncToken" expression="json-eval($.syncToken)"/> <googlecalendar.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <accessToken>{$ctx:accessToken}</accessToken> </googlecalendar.init> <googlecalendar.listSettings> <maxResults>{$ctx:maxResults}</maxResults> <pageToken>{$ctx:pageToken}</pageToken> <syncToken>{$ctx:syncToken}</syncToken> </googlecalendar.listSettings> <respond></respond> </inSequence> <outSequence> <send></send> </outSequence> <faultSequence> <property name="ERROR_CODE" value="600500"/> <property name="ERROR_MESSAGE" value="Internal Server Error"/> <property name="messageType" value="application/json" scope="axis2"/> <sequence key="faultHandlerSeq"/> </faultSequence> </target> </proxy>