This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

OperationDescription
reddit_registercreate new reddit account.
redditSetPasswordSet 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.

Sample Request for reddit_register
<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.

Sample Request for redditSetPassword
<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.

Sample Proxy
<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>

  • No labels