Search for Pages

Using HAPI, you can search for pages easily! You can use these methods to create a log or as a start to another HAPI script.

Tips for writing scripts with CQL and HAPI

  • You can use the methods outlined on this page with other HAPI methods.
  • Where there are CQL statements in example scripts, you can use any CQL statements to modify the scripts to work for you. Visit the CQL Guide for help with CQL.

Get a page by ID

Finding the ID of a page

Learn how to find the page ID here.

The page ID of the page created on Create a Page is 2031640, so we will use that in the example. To access a page by ID, run a script like this in the Script Console:

Pages.getById(2031640).title

After running this script, the page based on ID is retrieved and you will see the page title in the Result. 

The result to the HAPI script, which is the name of the page with the page ID used in the script

Customize the above script

You can customize the script by changing the page ID:

Pages.getById(PAGEID).title

Search pages

To search for pages by space, use a script like this in the Script Console:

Pages.search("space = DS")

After running this script, you will have a list of pages in the space and see the page creation date printed in the log.

The result of the HAPI script, which is a list of the pages in the space.



Related pages


On this page