Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[ Overview ] [ Operation details ] [ Sample configuration ]

Anchor
Overview
Overview
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.

OperationDescription
getUserSubredditInfoRetrieves subreddits information of the user.
getSubredditKarmaRetrieves karma points of the user.
getUserModeratorSubredditRetrieves moderator information of the user.

Anchor
OperationDetails
OperationDetails
Operation details

This section provides the details on each operation related to Subreddit scope.

Anchor
getUserSubredditInfo
getUserSubredditInfo
Get subreddit information of the user

To retrieves the subreddits of the user, use <reddit.getUserSubredditInfo/> operation.

Code Block
titleSample Request for getUserSubredditInfo
<reddit.init>
    <accessToken>{$ctx:accessToken}</accessToken>
</reddit.init>
    <reddit.getUserSubredditInfo/>

Anchor
getSubredditKarma
getSubredditKarma
Get subreddit karma points information of the user

To retrieves the subreddits karma points of the user, use <reddit.getSubredditKarma/> operation.

Code Block
titleSample Request for getSubredditKarma
<reddit.init>
   <apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth>
   <apiVersion>{$ctx:apiVersion}</apiVersion>
  <accessToken>{$ctx:accessToken}</accessToken>
 </reddit.init>
 <reddit.getSubredditKarma/>

Anchor
getUserModeratorSubreddit
getUserModeratorSubreddit
Get moderator information of the user

To retrieves the moderator information of the user, use <getUserModeratorSubreddit> operation.

Code Block
titleSample Request for getUserModeratorSubreddit
<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>
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

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 getUserModeratorSubreddit operation. The sample request for this proxy can be found in getUserModeratorSubreddit sample request.

Code Block
titleSample Proxy
<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>