Work with Labels
Learn about how to use HAPI to find and add labels.
HAPI makes it easier for you to add and find labels!
Add labels
Using HAPI, you can add one or multiple labels designated in the script. The page ID of the page created on Create a Page is 196721, so we will use that in the example.
Get labels from a page
Using HAPI, you can see what labels are on a page. For this example, we will use the same page ID from the above example. To get labels from a page, use a script like this:
def page = Pages.getById(196721)
def labelsOnPage = page.getLabels()After the script finishes running, the labels appear in the log:
You can customize the script by changing the page ID.