Forum Discussion

janh's avatar
janh
Mentor
12 years ago

Retrieving the Tag ID through REST

Hi guys,   I appear to be in bit of a bind. Currently I'm modifying the Tag View Page to use a customized thread list appearance but I need to create 'View All' link for sections 'Recently Tagged' ...
  • AdamN's avatar
    12 years ago

    To get the ID of a tag via the REST API given the tag text, you can use the following call:

    /restapi/vc/tagging/tags/text/tagname

    For example:

    http://lithosphere.lithium.com/restapi/vc/tagging/tags/text/rest%20api

     

    In the response, you'll see an "id" element, which tells you the ID of the tag. For example:

    <response status="success">
      <tag type="tag" href="/tagging/tags/id/720">
        <id type="int">720</id>
        <text type="string">rest api</text>
      </tag>
    </response>