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

Working with Forums in Disqus



Overview

The following operations allow you to work with forums. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with forums, see Sample configuration

OperationDescription

getForumDetails

Returns forum details.

listForumUsersReturns a list of users.

Operation details

This section provides further details on the operations related to forums.

Returning forum details

The getForumDetails operation returns forum details.

getForumDetails
<disqus.getForumDetails>
    <forumId>{$ctx:forumId}</forumId>
	<related>{$ctx:related}</related>
</disqus.getForumDetails>
Properties
  • forumId: The ID of the Disqus forum to retrieve.
  • related: Set to "author" if you want to return information on the author in the response.
Sample request

Following is a sample REST/JSON request that can be handled by the getForumDetails operation.

Sample Request for getForumDetails
{
    "forumId": "java-ee-forum",
    "apiUrl": "https://disqus.com",
    "apiKey": "hNCiYG7sBpsyavTbpysXNgHKJ8YDb9IFr3LpcVGj3eEZTPCicTJxNBoHub4etovu",
    "related": "author"
}
Related Disqus documentation

https://disqus.com/api/docs/forums/details/

Returning a list of users

The listForumUsers operation returns a list of users active within a forum. 

listForumUsers
<disqus.listForumUsers>
    <forumId>{$ctx:forumId}</forumId>
    <cursor>{$ctx:cursor}</cursor>
    <limit>{$ctx:limit}</limit>
    <order>{$ctx:order}</order>
	<sinceId>{$ctx:sinceId}</sinceId>
</disqus.listForumUsers>
Properties
  • forumId: The ID of the Disqus forum to retrieve.
  • cursor: The pagination parameter.
  • limit: The maximum number of posts to return.
  • order: The order of entries returned: "ASC" or "DESC" (default).
  • sinceId: Returns users joined since the given date ID.
Sample request

Following is a sample REST/JSON request that can be handled by the listForumUsers operation.

Sample Request for listForumUsers
{
    "limit": "2",
    "sinceId": "126914282",
    "cursor": "",
    "order": "desc",
    "forumId": "palaforum",
    "apiUrl": "https://disqus.com",
    "apiKey": "hNCiYG7sBpsyavTbpysXNgHKJ8YDb9IFr3LpcVGj3eEZTPCicTJxNBoHub4etovu"
}
Related Disqus documentation

https://disqus.com/api/docs/forums/listUsers/

Sample configuration

Following is a sample proxy service that illustrates how to connect to Disqus with the init operation and use the getForumDetails operation. The sample request for this proxy can be found in the getForumDetails sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="disqus_getForumDetails" startOnLoad="true" statistics="disable" trace="disable" transports="https,http" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence onError="faultHandlerSeq">
            <property name="apiUrl" expression="json-eval($.apiUrl)"/>
            <property name="apiKey" expression="json-eval($.apiKey)"/>
            <property name="forumId" expression="json-eval($.forumId)"/>
            <property name="related" expression="json-eval($.related)"/>
            <disqus.init>
                <apiUrl>{$ctx:apiUrl}</apiUrl>
                <apiKey>{$ctx:apiKey}</apiKey>
            </disqus.init>
            <disqus.getForumDetails>
                <forumId>{$ctx:forumId}</forumId>
                <related>{$ctx:related}</related>
            </disqus.getForumDetails>
            <respond/>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>