Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to pass the page_title and space_key as input variable in confluence API using curl? Edited

Hi Folks,

Could anyone share the confluence api curl syntax having input of page-title and space key.

I would appreciate if anyone send the CURL in order to get the page_id from JSON.

Thanks in advance


2 answers

1 accepted

0 votes
Answer accepted

@Mario Abud Thanks for your reply.

I have tried the below

curl -u admin:admin -X GET "{page_title}%20Title&spaceKey={Key_name}&expand=history"

Getting response like "No JSON object could be decoded".

Could you please let me know if i did anything wrong.

Hi @Bhakya 

Try this please, curl -u username:password -H "Content-Type: application/json" -X GET "http://localhost:8080/rest/api/content?spaceKey=TST&title=PageTitle&expand=history"

You have to change the part that says username, password,PageTitle and TST, with your data

Do you have Confluence Server or Confluence Cloud?


@Mario Abud 

I am having Confluence cloud

Okay for Confluence Cloud first generate an api token, sorry I thought you had Confluence Server

I just tried the code and it worked

curl -D- \ -u email:apitoken \ -X GET \ -H "Content-Type: application/json" \


@Mario Abud .How can i came to know whether i am using confluence server or cloud?

I need to update the confluence page through jenkins Job

@Mario Abud ,

Thanks for the information.

I have already gone through this page (How to publish a Confluence(Cloud) Page in Jenkins ) in which am not sure how to get the page id dynamically having inputs of Page title or space key.Could you please help me out how to get the page id of the confluence from Jenkins.



I just tried to get the Page_id using below

$(curl -u admin:XXX -X GET \ "${Confluence_Page_Title}&spaceKey=${Confluence_Space_Key}" | python -mjson.tool | grep '\"id\"' )

Getting 404 error since the key and page title are available in confluence.

0 votes
Mario Abud Community Leader Feb 04, 2020

Hi @Bhakya , you can see if this code works for you

curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?title=myPage%20Title
&spaceKey=TST&expand=history" | python -mjson.tool


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center Apps Program coming soon

G’day Bamboo customers, As we approach GA for Bamboo Data Center , we would like to inform you that the Data Center Apps Program for Bamboo starts this quarter. How long does it take? We are g...

61 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you