Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get content with url confluence REST API

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

like image 443
adjective_name Avatar asked Feb 06 '15 01:02

adjective_name


People also ask

How do I call a Confluence REST API?

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).

How do I retrieve data from Confluence?

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.

How do I REST API documents in Confluence?

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.

How do I embed a URL in Confluence?

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).


1 Answers

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.

like image 157
James McLeod Avatar answered Oct 06 '22 00:10

James McLeod