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

OperationDescription
getUserInboxMessagesRetrieves the inbox messages of the user.
getUserSentMessagesInfoRetrieves the sent messages of the user.
getUserNotificationsRetrieves the notifications of the user.

Anchor
OperationDetails
OperationDetails
Operation details

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

Anchor
getUserInboxMessages
getUserInboxMessages
Get information of a user inbox messages

To retrieves the inbox messages of the user, use <reddit.getUserInboxMessages> operation.

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

Anchor
getUserSentMessagesInfo
getUserSentMessagesInfo
Get information of a user sent messages

To retrieves the sent messages of the user, use <reddit.getUserSentMessagesInfo> operation.

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

Anchor
getUserNotifications
getUserNotifications
Get information of a user notifications

To retrieves the notifications of the user, use <reddit.getUserNotifications> operation.

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

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

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