[ Overview ] [ Operation details ] [ Sample configuration ]
OverviewThe following operations allow you to work with Public methods 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 Public methods, see Sample configuration.
Anchor |
---|
| OperationDetails |
---|
| OperationDetails |
---|
|
Operation detailsThis section provides the details on each operation related to public methods.
Restart the server and deploy the Reddit configuration.
Code Block |
---|
|
<reddit.init>
<apiUrl>https://www.reddit.com</apiUrl>
</reddit.init> |
Anchor |
---|
| reddit_register |
---|
| reddit_register |
---|
|
Create a new reddit accountTo register new reddit account, use <reddit.reddit_register> operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for reddit_register |
---|
|
<reddit.reddit_register>
<user>conUser</user>
<email>xyz@gmail.com</email>
<password1>123456</password1>
<password2>123456</password2>
<destination>Colombo</destination>
<rem>true</rem>
<reason>testing</reason>
</reddit.reddit_register> |
Anchor |
---|
| redditSetPassword |
---|
| redditSetPassword |
---|
|
Set the password of reddit accountTo set the password for the reddit account, use <reddit.redditSetPassword> operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for redditSetPassword |
---|
|
<reddit.redditSetPassword>
<userName>conUser</userName>
</reddit.redditSetPassword> |
Properties
- user: user name
- email: Email Address
- password1: password for account
- password2: password for account (it should be same as password1)
- destination: Destination .
- rem: rem is a boolean value which is need to register new account
- reason: Purpose for creating account
- userName: Existing reddit user name
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|
Sample configurationFollowing is a sample proxy service that illustrates how to connect to Reddit with the init
operation to use the redditSetPassword
operation. The sample request for this proxy can be found in redditSetPassword sample request.
Code Block |
---|
|
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="reddit_redditSetPassword"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="apiUrl" expression="json-eval($.apiUrl)"/>
<property name="userName" expression="json-eval($.userName)"/>
<reddit.init>
<apiUrl>{$ctx:apiUrl}</apiUrl>
</reddit.init>
<reddit.redditSetPassword>
<userName>{$ctx:userName}</userName>
</reddit.redditSetPassword>
<respond/>
</inSequence>
<outSequence>
<log/>
<send/>
</outSequence>
</target>
<description/>
</proxy> |
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|