Versions Compared

Key

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

...

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

Restart the server and deploy the Reddit configuration.

Code Block
languagexml
titleinit
<reddit.init>
	<accessToken>42591910-APa9HJeLE1jV2EjpIxigdTi79mw</accessToken>
</reddit.init>

Anchor
getUserInboxMessages
getUserInboxMessages
Get information of a user inbox messages

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

Code Block
languagexml
titleSample Request for getUserInboxMessages
<reddit.init>
    <accessToken>{$ctx:accessToken}</accessToken>
</reddit.init>
<reddit.getUserInboxMessages>
    <after>{$ctx:after}<	<after>1_cu7fp83</after>
    <before>{$ctx:before}<<before>t1_ctw5sns</before>
    <count>{$ctx:count}<<count>0</count>
    <mark>{$ctx:mark}<<mark>true</mark>
    <limit>{$ctx:limit}<<limit>25</limit>
    <show>{$ctx:show}<<show>all</show>
    <mid>{$ctx:mid}</mid>
   <srDetail>{$ctx:srDetail}<	<srDetail>yes</srDetail>
</reddit.getUserInboxMessages>

...

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

Code Block
languagexml
titleSample Request for getUserSentMessagesInfo
<reddit.init>
    <accessToken>{$ctx:accessToken}</accessToken>
</reddit.init>
<reddit.getUserSentMessagesInfo>
    <after>{$ctx:after}<<after>t4_3wdt8g</after>
    <before>{$ctx:before}<<before>t4_3w7lcd</before>
    <count>{$ctx:count}<<count>0</count>
    <mark>{$ctx:mark}<<mark>true</mark>
    <limit>{$ctx:limit}<<limit>25</limit>
    <show>{$ctx:show}<<show>all</show>
    <mid>{$ctx:mid}</mid>
   <srDetail>{$ctx:srDetail}<	<srDetail>yes</srDetail>
</reddit.getUserSentMessagesInfo>

...

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

Code Block
languagexml
titleSample Request for getUserNotifications
<reddit.init>
    <apiUrlOauth>{$ctx:apiUrlOauth}</apiUrlOauth>
    <apiVersion>{$ctx:apiVersion}</apiVersion>
    <accessToken>{$ctx:accessToken}</accessToken>
</reddit.init>
<reddit.getUserNotifications>
     <count>{$ctx:count}<<count>0</count>
     <endDate>{$ctx:endDate}<<endDate>1439291258</endDate>
     <startDate>{$ctx:startDate}<<startDate>1439014025</startDate>
     <sort>{$ctx:sort}<<sort>new</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

...

  • message

  • endDate:

...

  • End

...

  • date

...

  • of

...

  • the

...

  • notifications

  • startDate:

...

  • Start

...

  • date

...

  • of

...

  • the

...

  • notifications

Anchor
sampleconfiguration
sampleconfiguration
Sample configuration

...

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>