[ Overview ] [ Operation details ] [ Sample configuration ]
Overview
The 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.
Operation | Description |
---|---|
reddit_register | create new reddit account. |
redditSetPassword | Set the password for the registered account |
Operation details
This section provides the details on each operation related to public methods.
Create a new reddit account
To register new reddit account, use <reddit.reddit_register> operation.
<reddit.init> <apiUrl>{$ctx:apiUrl}</apiUrl> </reddit.init> <reddit.reddit_register> <user>{$ctx:user}</user> <email>{$ctx:email}</email> <password1>{$ctx:password1}</password1> <password2>{$ctx:password2}</password2> <destination>{$ctx:destination}</destination> <rem>{$ctx:rem}</rem> <reason>{$ctx:reason}</reason> </reddit.reddit_register>
Set the password of reddit account
To set the password for the reddit account, use <reddit.redditSetPassword> operation.
<reddit.init> <apiUrl>{$ctx:apiUrl}</apiUrl> </reddit.init> <reddit.redditSetPassword> <userName>{$ctx:userName}</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
Sample configuration
Following 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.
<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>