Forum Discussion

wds_ua_dendy's avatar
12 years ago

Querying recent topics by tag via REST API

I'm trying to implement forum topics search by tags by using REST API.

I know there is an API for single tag:

 

/tagging/for/tags/text/tagName/messages

 

, but it doesn't work for multiple tags.

 

So looks like best API for this is to use:

search/messages with query like this: q=tags:(Apple OR Google)

The problem is that response contains messages rather then topics, so I additionally have to query each message to retrieve topic information (title, kudos, replies count by topic).

 

Is there a possibility to retrive multiple topics (or messages) by specifying there ids (or thread ids), something like this:

q=id:(1111 OR 2222) or q=thread_id:(1111 OR 2222) ?

Or maybe is there another API that can fit my requirements?

 

4 Replies

  • I'm aware of this parameter collapse_discussion, but it doesn't help to retrive topic information (kudos, reply count).

  • Hi,

      I am working on the same project, we could use some additional help here.

     

     

    1) The collapse_discussion paramenter is not what we are looking for here.

     

    Quick recap:

     

    We are implementing a forum where the user can check one or many checkboxes, each of which represents a tag. When then check a checkbox for "Apple" they see posts that contain the tag Apple. If the user then clicks on "AT&T" they will see a list of Threads/Topics whos messages contains Apple and AT&T as tags. 

     

    If you want to look for something that has 2 (or more) specific tags, you must use:

    http://radioshack.stage.lithium.com/radioshack/restapi/vc/search/messages?q=tags%3A(iPhone)+AND+(Apple)

     

    This API call returns a response containing a bunch of Messages that contain those tags. Great.

     

    The Problem:

    We dont want to show a list of messages, because there could be 10 messages within the same Topic/Thread. We want to show a list of Threads/Topics, including information like the total Kudos in the thread, and the total Reply count in the thread, etc.

     

    So currently we get back a list of 50 messages that contain these tags from the API, before we can display any useful information about the whole topic, we have to make  (up to )50 API calls for each thread ID to find out: Its original Author, its Kudos Count, Its Read/Reply count, the original thread name, etc. This is obviously slowing things down a lot.

     

    Ideally, we would just use some API method like this:

    http://radioshack.stage.lithium.com/radioshack/restapi/vc/search/threads?q=tags%3A(iPhone)+AND+(Apple)

     

    But the /threads doesnt support the search method.

     

    Can you guys think of anything else we can can do that would help us here?