Forum Discussion

Ashish_Rai's avatar
6 years ago

Popular Topics and Labels

I am interested in pulling Trending Topics from the community forum. Now I understand there there 'getPopularTopics' function. But I am interested in getting trending/popular labels and related topic...
  • luk's avatar
    luk
    6 years ago

    Ashish_Rai nope, unfortunately still not possible to get multiple labels with API v2, see here, the only operator allowed in the constraint is "=", not "IN()", you would need to resort back to API v1 =/: 

    /restapi/v1/categories/id/<category.id>/labels?page_size=100&restapi.response_format=json

    the problem with v1 is, that it does not give you any context-information whatsoever, e.g. once you got your labels from API v1, you'll need to loop trough ALL of them and issue a s***load of v2 queries (min 1 for each label, possibly more) to get the information you need (e.g. messages with that label, how many views, kudos etc. those messages have and so on)... it is certainly possible from a technical standpoint somehow, but Khoros definitely does not make it easy for us to do so and we have to keep an eye on possible performance implications as well when doing such things...