Forum Discussion

neel_psl's avatar
8 years ago

Is there an api to get list of Custom Tags?

Hi,

We have an option of custom-tags being enabled therefore we want to fetch the list of custom-tags in to a custom component so is there any api for the same? Or do we have any such component which has the list of custom-tags??

 

Thanks

6 Replies

  • shravani's avatar
    shravani
    Guide
    8 years ago

    We need an api where we can get the list of custom tags which are added from community only.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    HI shravani neel_psl Try this one. 

    /restapi/vc/tagging/tags/all/count
    /restapi/vc/tagging/tags/all?page_size=n     where n = tags count

     

  • shravani's avatar
    shravani
    Guide
    8 years ago

    Hi VikasB,

    This api is returning all the tags. We need only those tags which are added from admin mod tools.

  • srujanayeruvaka's avatar
    srujanayeruvaka
    Champion
    8 years ago

    Hi shravani,

     

    Do you mean custom tags added from Admin -> Mod Tools -> Custom Tags?
    If yes, then I don't think there is a V1 API to retrieve these. However, you could use V2 API to fetch custom tags associated with a message. But, at this time, a LiQL query of the custom_tag collection must be constrained by a single message ID. For example:

     

    SELECT * FROM custom_tags WHERE messages.id='nnn'

     

     You may have to make multiple calls for all message and get the list, but this still does not give you all the custom tags. It only gives what have been used in the posts.

     

    Hope this helps!

     

    Thanks,

    Srujana.