Using API to get page content by label

Gavin Ireland
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2019

I want to extract content from a Confluence Cloud space, by label, so it can be re-used in another website elsewhere. Can that be done via the API?

1 answer

1 accepted

2 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2019

Hello Gavin and welcome to the Community!

The simplest way to access Confluence pages by label would be to use the endpoint called “Search Content by CQL”. More on this endpoint may be found at GET /wiki/rest/api/content/search.

This endpoint will allow you to search using CQL with your API call. This allows you to filter based on the anything available within the CQL functions. More on CQL may be found at Advanced searching using CQL.

A sample of how this would look is as follows:

http://confluence.server.com/rest/api/content/search?cql=type=page%20AND%20label=SOMETHING

I hope this proves helpful in your ability to find content by label within Confluence.

Regards,
Stephen Sifers  

luketelo_joseph
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 22, 2022

The sample url above did not work for me. I had to include wiki in the url for it to work.

This worked for me 

http://confluence.server.com/wiki/rest/api/content/search?cql=type=page%20AND%20label=SOMETHING

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events