Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

confluence - get specific text in a page with api

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2021

Hi,

I was wondering is there a way to surround text in a page and then get that text from that page through an API call to the confluence page?

 

Any examples?

Thanks

2 answers

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2021

The api doesn't have calls to interrogate the content beyond "get the content".

This is the same as the browser functionality - the page is rendered, then your human says "I'd like to pick out a bit of it that has been flagged in some way" - they search in the content that is in front of them in the browser, not by asking Confluence for it.

So the simple answer is "no", but you can do it - you use the API to fetch the content of the page, then write code that can search for and extract the content for what you are looking for.

0 votes
Gaurav
Community Champion
November 19, 2021

Hello @Gavin 

APIs can be used to search for text in Confluence. The complete documentation can be referenced here.

Kindly accept the answer if this helps.

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2021

thank you for sharing the answer.  But wasn't looking to search.  But trying to pull specific text from a specific wiki page.  

 

for example

wikiPage1

<data1>Hello world</data1

 

api to query page wikiPag1 for the value of data1 results hello world.

 

hope that clarifies more.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events