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 Subreddit Scope
[ Overview ] [ Operation details ] [ Sample configuration ]
Overview
The following operations allow you to work with Subredit 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 Subredit scope, see Sample configuration.
Operation | Description |
---|---|
Retrieves subreddits information of the user. | |
Retrieves karma points of the user. | |
Retrieves moderator information of the user. |
Operation details
This section provides the details on each operation related to Subreddit scope.
Restart the server and deploy the Reddit configuration.
<reddit.init> <apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth> <apiVersion>{$ctx:apiVersion}</apiVersion> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init>
Get subreddit information of the user
To retrieves the subreddits of the user, use <reddit.getUserSubredditInfo/> operation.
<reddit.getUserSubredditInfo/>
Get subreddit karma points information of the user
To retrieves the subreddits karma points of the user, use <reddit.getSubredditKarma/> operation.
<reddit.getSubredditKarma/>
Get moderator information of the user
To retrieves the moderator information of the user, use <getUserModeratorSubreddit> operation.
<reddit.getUserModeratorSubreddit> Â Â <after>t1_cu7fp83</after> Â Â <before>t1_ctw5sns</before> Â Â <count>0</count> Â Â <limit>25</limit> Â Â <show>all</show> Â Â <srDetail>yes</srDetail> </reddit.getUserModeratorSubreddit>
Properties
- after: Fullname of a thing
- before: Fullname of a thing
- count: A positive integer (default: 0)
- limit: The maximum number of items desired (default: 25, maximum: 100)
- show: Show whether the string all or not
- srDetail: Expand subreddits
Sample configuration
Following is a sample proxy service that illustrates how to connect to Reddit with the init
operation to use the getUserModeratorSubreddit
operation. The sample request for this proxy can be found in getUserModeratorSubreddit sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="reddit_getUserModeratorSubreddit" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="after" expression="json-eval($.after)"/> <property name="before" expression="json-eval($.before)"/> <property name="count" expression="json-eval($.count)"/> <property name="limit" expression="json-eval($.limit)"/> <property name="show" expression="json-eval($.show)"/> <property name="srDetail" expression="json-eval($.srDetail)"/> <reddit.init> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getUserModeratorSubreddit> <after>{$ctx:after}</after> <before>{$ctx:before}</before> <count>{$ctx:count}</count> <limit>{$ctx:limit}</limit> <show>{$ctx:show}</show> <srDetail>{$ctx:srDetail}</srDetail> </reddit.getUserModeratorSubreddit> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>