Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
getPost
getPost
Returning information about a post

The getPost getPost  operation returns information about a post.

Code Block
languagexml
titlegetPost
<disqus.getPost>
    <related>{$ctx:related}</related>
	<postId>{$ctx:postId}</postId>
</disqus.getPost>
Properties
  • related: Related information to return in the response: "forum" and/or "thread".
  • postId: The ID of the post to retrieve.

...

Code Block
languagexml
titlelistPosts
<disqus.listPosts>
    <forumId>{$ctx:forumId}</forumId>
    <categoryId>{$ctx:categoryId}</categoryId>
    <since>{$ctx:since}</since>
    <cursor>{$ctx:cursor}</cursor>
    <limit>{$ctx:limit}</limit>
    <query>{$ctx:query}</query>
    <popular>{$ctx:popular}</popular>
    <interval>{$ctx:interval}</interval>
    <offset>{$ctx:offset}</offset>
    <include>{$ctx:include}</include>
    <order>{$ctx:order}</order>
    <related>{$ctx:related}</related>
    <threadId>{$ctx:threadId}</threadId>
	<userId>{$ctx:userId}</userId>
</disqus.listPosts>
Properties
  • forumId:  The ID of the Disqus forum to retrieve.
  • categoryId:  The ID of the category whose posts should be retrieved.
  • since: The UNIX time stamp (or ISO date time standard).
  • cursor:  The pagination parameter.
  • limit:  The maximum number of posts to return.
  • query:  The query to filter the lists that are returned as part of the response.
  • popular:  Whether to pick the popular posts.
  • interval:  The interval of posts, one of: 1h, 6h, 12h, 1d, 3d, 7d, 30d, 60d, or 90d.
  • offset:  The offset from the interval.
  • include: The types of posts to include: "unapproved", "approved" (default), "spam", "deleted", "flagged", and/or "highlighted".
  • order:  The order of entries returned. Choices: "ASC" or "DESC" (default).
  • related:  Specifies related information to include in the response: "forum" and/or "thread".
  • threadId:  The ID of the Disqus forum to retrieve.
  • userId:  The ID of the user whose posts are to be retrieved.
Special Notes
Info
title

The table below explains how the which Disqus API method (endpoint) is chosen used for the listPosts method based on request parameters. Please refer to the specific end points for optional parameters when testing different end points operation based on the request properties. For example, if popular is set to true, https://disqus.com/api/3.0/posts/listPopular.json will always be used to process the request. If popular is set to false, and the threadId is provided, https://disqus.com/api/docs/threads/listPosts.json will be used regardless of whether values are provided for categoryId, forumId, and userId/accessToken, and if threadId is not provided but categoryId is provided, https://disqus.com/api/docs/categories/listPosts.json will be used regardless of whether values are provided for forumId and userId/accessToken.

Priority

Parameter

EP 1

EP 2

EP 3

EP 4

EP 5

1

popular

"true"

-

-

-

-

2

threadId

*

provided

-

-

-

3

categoryId

*

*

provided

-

-

4

forumId

*

*

*

provided

-

5

userId/accessToken

*

*

*

*

provided

* Will not be considered when deciding even when a value is supplied in the request. In case of optional parameters, they will be added as they are.

EP 1 endpoint:

https://disqus.com/api/3.0/posts/listPopular.json

EP 2 endpoint:

https://disqus.com/api/docs/threads/listPosts.json

EP 3 endpoint:

https://disqus.com/api/docs/categories/listPosts.json

EP 4 endpoint:

https://disqus.com/api/docs/forums/listPosts.json

EP 5 endpoint:

https://disqus.com/api/docs/users/listPosts.json

...

Code Block
languagexml
titleSample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="disqus_getPost" 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="apiSecret" expression="json-eval($.apiSecret)"/>
            <property name="accessToken" expression="json-eval($.accessToken)"/>
            <property name="related" expression="json-eval($.related)"/>
            <property name="postId" expression="json-eval($.postId)"/>
            <disqus.init>
                <apiUrl>{$ctx:apiUrl}</apiUrl>
                <apiKey>{$ctx:apiKey}</apiKey>
                <apiSecret>{$ctx:apiSecret}</apiSecret>
                <accessToken>{$ctx:accessToken}</accessToken>
            </disqus.init>
            <disqus.getPost>
                <related>{$ctx:related}</related>
                <postId>{$ctx:postId}</postId>
            </disqus.getPost>
            <respond/>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
    </target>
    <description/>
</proxy>