[ Overview ] [ Operation details ] [ Sample configuration ]
Overview
The following operations allow you to work with Private Messages 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 Private Messages scope, see Sample configuration.
Operation | Description |
---|---|
getUserInboxMessages | Retrieves the inbox messages of the user. |
getUserSentMessagesInfo | Retrieves the sent messages of the user. |
getUserNotifications | Retrieves the notifications of the user. |
Operation details
This section provides the details on each operation related to Private Messages scope.
Get information of a user inbox messages
To retrieves the inbox messages of the user, use <reddit.getUserInboxMessages> operation.
<reddit.init> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getUserInboxMessages> <after>{$ctx:after}</after> <before>{$ctx:before}</before> <count>{$ctx:count}</count> <mark>{$ctx:mark}</mark> <limit>{$ctx:limit}</limit> <show>{$ctx:show}</show> <mid>{$ctx:mid}</mid> <srDetail>{$ctx:srDetail}</srDetail> </reddit.getUserInboxMessages>
Get information of a user sent messages
To retrieves the sent messages of the user, use <reddit.getUserSentMessagesInfo> operation.
<reddit.init> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getUserSentMessagesInfo> <after>{$ctx:after}</after> <before>{$ctx:before}</before> <count>{$ctx:count}</count> <mark>{$ctx:mark}</mark> <limit>{$ctx:limit}</limit> <show>{$ctx:show}</show> <mid>{$ctx:mid}</mid> <srDetail>{$ctx:srDetail}</srDetail> </reddit.getUserSentMessagesInfo>
Get information of a user notifications
To retrieves the notifications of the user, use <reddit.getUserNotifications> operation.
<reddit.init> <apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth> <apiVersion>{$ctx:apiVersion}</apiVersion> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getUserNotifications> <count>{$ctx:count}</count> <endDate>{$ctx:endDate}</endDate> <startDate>{$ctx:startDate}</startDate> <sort>{$ctx:sort}</sort> </reddit.getUserNotifications>
Properties
after: Fullname of a thing(start thing_id of the message)
before: Fullname of a thing
count: A positive integer (default: 0)
mark: A boolean value(true or false)
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
mid: Mid thing_id of the messages
endDate: End date of the notifications
startDate: Start date of the notifications
Sample configuration
Following is a sample proxy service that illustrates how to connect to Reddit with the init
operation to use the getUserSentMessagesInfo
operation. The sample request for this proxy can be found in getUserSentMessagesInfo sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="reddit_getUserSentMessagesInfo" 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="mid" expression="json-eval($.mid)"/> <property name="srDetail" expression="json-eval($.srDetail)"/> <property name="mark" expression="json-eval($.mark)"/> <reddit.init> <accessToken>{$ctx:accessToken}</accessToken> </reddit.init> <reddit.getUserSentMessagesInfo> <after>{$ctx:after}</after> <before>{$ctx:before}</before> <count>{$ctx:count}</count> <mark>{$ctx:mark}</mark> <limit>{$ctx:limit}</limit> <show>{$ctx:show}</show> <mid>{$ctx:mid}</mid> <srDetail>{$ctx:srDetail}</srDetail> </reddit.getUserSentMessagesInfo> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>