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 Read Scope
[ Overview ] [ Operation details ] [ Sample configuration ]
Overview
The following operations allow you to work with Read 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 Read scope, see Sample configuration.
Operation | Description |
---|---|
Retrieves public multis information of the reddit user. | |
Retrieves user multis information of the user. | |
Retrieves search information of the user. |
Operation details
This section provides the details on each operation related to Read scope.
Restart the server and deploy the Reddit configuration.
<reddit.init> <apiUrlOauth>https://oauth.reddit.com</apiUrlOauth> Â <accessToken>42591910-APa9HJeLE1jV2EjpIxigdTi79mw</accessToken> </reddit.init>
Get information of public multis
To retrieves the public multis of the user, use <reddit.getAnyUserPublicMultisList> operation.
<reddit.getAnyUserPublicMultisList> <userName>Thumperings</userName> <expandSrs>true</expandSrs> </reddit.getAnyUserPublicMultisList>
Get information of current user multis
To retrieves the user multis of the user, use <reddit.getCurrentUserMultisList> operation.
<reddit.getCurrentUserMultisList> Â Â <expandSrs>true</expandSrs> </reddit.getCurrentUserMultisList>
Get search thing
To retrieves the search item, use <reddit.search> operation.
<reddit.search> Â Â <after>t3_3hxrlz</after> Â Â <before>t3_3g4plh</before> Â Â <count>1</count> Â Â <includeFacets>true</includeFacets> Â Â <limit>130</limit> Â Â <str>string</str> Â Â <restrictSr>false</restrictSr> Â Â <show>given</show> Â Â <sort>hot</sort> Â Â <srDetail>yes</srDetail> Â Â <syntax>cloudsearch</syntax> Â Â <time>all</time> Â Â <type>{$ctx:type}</type> </reddit.search>
Properties
- after: Fullname of a thing
- before: Fullname of a thing
- count: A positive integer (default: 0)
- includeFacets: A boolean value
- limit: The maximum number of items desired (default: 25, maximum: 100)
- show: Show whether the string all or not
- sort: One of (relevance, hot, top, new, comments)
- srDetail: Expand subreddits
- time: One of (hour, day, week, month, year, all)
- type: Comma-delimited list of result types (sr, link)
- syntax: One of (cloudsearch, lucene, plain)
- restrictSr: A boolean value
- str: A string
- expandSrs: A boolean value
- userName: Existing Reddit user name
Sample configuration
Following is a sample proxy service that illustrates how to connect to Reddit with the init
operation to use the getCurrentUserMultisList
operation. The sample request for this proxy can be found in getCurrentUserMultisList sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="reddit_getCurrentUserMultisList" 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="expandSrs" expression="json-eval($.expandSrs)"/> <reddit.init> <apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getCurrentUserMultisList> <expandSrs>{$ctx:expandSrs}</expandSrs> </reddit.getCurrentUserMultisList> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>