Overview
The following operations allow you to work with categories. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with categories, see Sample configuration.
Operation | Description |
---|---|
Returns category details. | |
1Working with Categories in Disqus | Returns a list of categories. |
Operation details
This section provides further details on the operations related to categories.
Returning category details
The getCategoryDetails
operation returns category details.
<disqus.getCategoryDetails> <categoryId>{$ctx:categoryId}</categoryId> </disqus.getCategoryDetails>
Properties
The ID of the category to retrieve.categoryId:
Sample request
Following is a sample REST/JSON request that can be handled by the getCategoryDetails
operation.
{ "categoryId": "3329663", "apiUrl": "https://disqus.com", "apiKey": "hNCiYG7sBpsyavTbpysXNgHKJ8YDb9IFr3LpcVGj3eEZTPCicTJxNBoHub4etovu" }
Related Disqus documentation
https://disqus.com/api/docs/categories/details/
Returning a list of categories
The listCategories operation returns a list of categories within a forum.
<disqus.listCategories> <forumId>{$ctx:forumId}</forumId> <limit>{$ctx:limit}</limit> <order>{$ctx:order}</order> <cursor>{$ctx:cursor}</cursor> <sinceId>{$ctx:sinceId}</sinceId> </disqus.listCategories>
Properties
The ID of the Disqus forum to retrieve.forumId:
The maximum number of posts to return.limit:
The order of entries returned: "ASC" or "DESC" (default).order:
The pagination parameter.cursor:
Returns categories created since the given date ID.sinceId:
Sample request
Following is a sample REST/JSON request that can be handled by the listCategories operation.
{ "limit": "10", "sinceId": "3360607", "cursor": "", "order": "desc", "forumId": "java-ee-forum,palaforum", "apiUrl": "https://disqus.com", "apiKey": "hNCiYG7sBpsyavTbpysXNgHKJ8YDb9IFr3LpcVGj3eEZTPCicTJxNBoHub4etovu" }
Related Disqus documentation
https://disqus.com/api/docs/categories/list/
Sample configuration
Following is a sample proxy service that illustrates how to connect to Disqus with the init
operation and use the getCategoryDetails operation. The sample request for this proxy can be found in the getCategoryDetails sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy name="disqus_getCategoryDetails" 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="categoryId" expression="json-eval($.categoryId)"/> <disqus.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </disqus.init> <disqus.getCategoryDetails> <categoryId>{$ctx:categoryId}</categoryId> </disqus.getCategoryDetails> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>