barryhoffmann
11 years agoMentor
List of TAGS
When I post a discussion, I am asked to select a 'Add Tags' What is the Rest API call to retrieve a list of tags that are available on the Lithium site
Hi @barryhoffman ,
Please take a look at the below call. It return a list of weighted tags formed by grouping the tag events in this tagging context by tag, weighting the group by the count of the number of tag events in the group, and ordered by the tag text ascending.
/tagging/tags/all
You can find more details about the call here
Hope that helps.
Thanks,
Sam
Hi Sam,
I implemented your suggestion, but for some reason it only returns 25 instead of all of them.
Is there a setting somewhere in Lithium cobfiguration that only allows to return 25 entries.
I am experiencing the same limit problems with my search results of posts.
Kind Regards
Darryn Hart
you may want to include pagination parameters in your calls, for exmaple
http://community.lithium.com/restapi/vc/tagging/tags/all?page_size=2&page=2
page_size : to determine the size of the page
page : to indicate which page to look at
Hope it helps,
Hi barryhoffmann ,
In addition to what PaoloT mentioned , if you are using a custom component to display a list of all tags and paginate through them , you would find this post very useful .
However , if you just want all your tags , in one call itself , you can get a count of total tags using the below call.
/tagging/tags/all/count
and use that value as your page_size . For eg .,
/tagging/tags/all?page_size=177&page=1
Hope that helps.
Thanks,
Sam
Hi samudhraa
a word of caution with your last approach - there is usually a limit to the maximum number of elements that the API returns in a single page (I think it's normally one thousand) and so, if there are more than the limit number of tags, then you may not include all of them with that approach.
Lithium Support can change the limit to a bigger one, however it is not normally recommended to retrieve a large number of objects very frequently so a tradeoff must be considered. This can also be a good case for applying the newly released caching method - however the same considerations around the size of the response (that would be cached) apply.
Kind Regards,