Forums

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

I want to get the pageID using REST API.

青山 明
Contributor
December 18, 2021

I want to get the pageID using REST API. I tried the following, but it didn't work. What's wrong? Also, it is unclear how to get the JSON data when the pageID can be obtained. What should i do?

https://xxxxx.atlassian.net/wiki/rest/api/content/?title=testpj&spaceKey=TEST

1 answer

0 votes
Kishan Sharma
Community Champion
December 19, 2021

Hi @青山 明 Welcome to the Atlassian Community!

Below example shows how you can find a page by space key and title with history expanded to find the ID.

https://mysite.atlassian.net/wiki/rest/api/content?title=MyPageTitle&spaceKey=MySpace&expand=history

You can get JSON data via below -

curl -u admin:admin -X GET "https://mysite.atlassian.net/wiki/rest/api/content?title=MyPageTitle&spaceKey=MySpace&expand=history" | python -mjson.tool

Hope this helps.

青山 明
Contributor
December 19, 2021

Hi thank you for your answer. But this time, instead of running it in curl, Run with automation. In that case, I don't understand the JSON definition at the time of response. 

青山 明
Contributor
December 19, 2021

I solved it myself. Thank you very much.

Like Kishan Sharma likes this
Kishan Sharma
Community Champion
December 19, 2021

Good to know that you got it working.

If my answer was useful, you can mark it as accepted  or else you can post your own answer and mark it as accepted so that it will help others having similar question.

Like Pankaj Choudhary likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events