Hi I have noticed several ways to get the content with the REST API. Although I was wondering if there is a way to get the content directly from the url without calling the space and title.
Meaning if I have http://localhost:8080/display/TST/myPage
Instead of doing this
curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?title=myPage&spaceKey=TST" | python -mjson.tool
I can use the url on the rest api. Maybe something like this
curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content/display/TST/myPage" | python -mjson.tool
Is there a way to do this?
This is the documentation I have looked at
https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e865
Because the REST API is based on open standards, you can use any web development language to access the API. These examples use basic authentication with a username and password. You can also create a personal access token for authentication (Confluence 7.9 and later).
If you've got permission to view the page in Confluence, you'll be able to export it in this way; go to the page and choose Tools > Export to Word.
To use a REST API, your application will make an HTTP request and parse the response. By default, the response format is JSON. Your methods will be the standard HTTP methods: GET, PUT, POST and DELETE. The REST API is based on open standards, so you can use any web development language to access the API.
From the toolbar, select Link > Web Link then enter the website URL. Type or paste the URL onto the page (Confluence will automatically create the link).
Yes; immediately below the section you linked to, there is a description of the version of this request which takes an article ID: /rest/api/content/{id}. As long as you know the article ID, this is the easiest way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With