Forum Discussion

BradR's avatar
BradR
Khoros Alumni (Retired)
12 years ago

Tags, Messages, and RestAPI

Hi Developers,

 

I've got a particular use case that I'm hoping to find a better solution for.  Specifically, I've got a community w/ lots of tags (thousands) and I'd like to be able to retrieve the messages associated with each one.

 

I've discovered that I can retrieve my list of tags with:

 

/restapi/vc/tagging/tags/all

 

and then for each tag call:

 

/restapi/vc/tagging/for/tags/text/TAG_GOES_HERE/messages/recent

 

to get my message list.  However, with multiple thousands of tags, that means the latter call will be made multiple thousands of times.  Is there a more efficient way to achieve my goal: a list of messages associated with each tag in my community?

 

Thanks

  • I would query all messages through /posts.../recent, paging through them 1000 at a time and build up the tags that way...

    • BradR's avatar
      BradR
      Khoros Alumni (Retired)

      Now that I think about it, that does seem more efficient.  It's not what I'd hoped for - but if it's a question of iterate posts pull tags or iterate tags pull posts, the former is clearly better.  Thanks.

      • wmertens's avatar
        wmertens
        Expert
        Kudos appreciated dear Lithium employee that understands gamification ;-)