...
Overview
The following operations allow you to work with Identity scope in Reddit. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with Identity scope, see Sample configuration.
Anchor |
---|
| OperationDetails |
---|
| OperationDetails |
---|
|
Operation details
This section provides the details on each operation related to Identity scope.
Restart the server and deploy the Reddit configuration.
Code Block |
---|
|
<reddit.init>
<apiVersion>v1</apiVersion>
<apiUrlOauth>https://oauth.reddit.com</apiUrlOauth>
<accessToken>42591910-zkzl5EOCq19Duy8pScRgaPBiwSw</accessToken>
</reddit.init> |
Anchor |
---|
| getCurrentUserInfo |
---|
| getCurrentUserInfo |
---|
|
Get information of a user
To retrieves the user info , use <reddit.getCurrentUserInfo/> operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for getCurrentUserInfo |
---|
|
<reddit.getCurrentUserInfo/> |
Anchor |
---|
| getCurrentUserTrophies |
---|
| getCurrentUserTrophies |
---|
|
Get trophies information of a user
To retrieves the user info , use <reddit.getCurrentUserTrophies/> operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for getCurrentUserTrophies |
---|
|
<reddit.getCurrentUserTrophies/> |
Anchor |
---|
| getCurrentUserPreferences |
---|
| getCurrentUserPreferences |
---|
|
Get preferences information of a user
To retrieves the user info , use <getCurrentUserPreferences/> operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for getCurrentUserPreferences |
---|
|
<getCurrentUserPreferences/> |
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|
Sample configuration
Following is a sample proxy service that illustrates how to connect to Reddit with the init
operation to use the getCurrentUserPreferences
operation. The sample request for this proxy can be found in getCurrentUserPreferences sample request.
Code Block |
---|
|
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="reddit_getCurrentUserPreferences"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="accessToken" expression="json-eval($.accessToken)"/>
<property name="apiUrlOauth" expression="json-eval($.apiUrlOauth)"/>
<property name="apiVersion" expression="json-eval($.apiVersion)"/>
<reddit.init>
<apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth>
<apiVersion>{$ctx:apiVersion}</apiVersion>
<accessToken>{$ctx:accessToken}</accessToken>
</reddit.init>
<reddit.getCurrentUserPreferences/>
<respond/>
</inSequence>
<outSequence>
<log/>
</outSequence>
</target>
<description/>
</proxy> |