Forum Discussion

phoneboy's avatar
phoneboy
Director
4 years ago

How do you query for user-defined labels used in a given board (not the current one)?

Looking at the developer documentation for labels, it seems the only constraint allowed is a specific message ID. There doesn't appear to be a way to query a given board for the labels in use. Is i...
  • jeffshurtliff's avatar
    4 years ago

    I don't believe there is a way to get the labels via API v2 (i.e. LiQL) since, as you said, the only constraint in the message ID.  That being said, if you're trying to retrieve messages with a particular label then that can be done via the messages collection and the labels.text constraint. 

    But since it sounds like you're wanting a list of the actual labels used in a node to replicate the Popular Labels component or something similar, I would suggest using the API v1 Board.labels endpoint which should do the trick.