Forum Discussion

Gursimrat's avatar
Gursimrat
Leader
11 years ago

REST Api not working for Labels in restapi.response_style=view

I am making a REST call, /restapi/vc/messages/id/321/labels/labels?restapi.response_style=view but this is not returning additional details, i want friendly details such as view_href for labels, how do I make this call or fetch URL fro Labels from REST, the href only gives relative URL

 

response status="success">
<labels>
<label type="label" href="/labels/id/43">
<id type="int">43</id>
<text type="string">Results</text>
</label>
<label type="label" href="/labels/id/41">
<id type="int">41</id>
<text type="string">Running Experiments</text>
</label>
</labels>
</response>

 

3 Replies

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)
    11 years ago

    Hi Gursimrat 

    the reason why you are not getting a view_href is probably because view_href doesn't make sense for Labels as they don't have a visual representation.

     

    What would you expect to see should the label have a visual representation?

     

    Nico

  • samudhraa's avatar
    samudhraa
    Expert
    11 years ago

    Hi Gursimrat ,

     

    I don't think labels have URLs associated with them. They are usually text. Though I think we can customize to make a label as link , by adding a filter by label function to it.

     

    I think this REST call would return all posts with a particular label text associated with it.

     

    /restapi/vc/boards/id/video_cards/replies/for/labels/text/label_text
    /restapi/vc/posts/for/labels/text/label_text

     

    Hope that helps.

     

    Thanks,

    Sam