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

Utilizing the Confluence REST API

Julia June 29, 2020

Hi,

I am a little confused as to how to use the Confluence API. I am trying to use the API in order to create a new page in Confluence at the web address confluence."mycompany".com and post information onto that page in a space, but I don't think I understand how to do that with this API. If anyone can help me out, that would be great. Thank you!

2 answers

1 vote
Oliver Siebenmarck _Polymetis Apps_
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.
June 29, 2020

Hi @Julia ,

Welcome to the community!

I'm guessing that your company uses Confluence server (as opposed to Confluence Cloud), so my answer is based on that. 

Using the REST API is the easiest way to programmatically access and work with data in Confluence, so you are on the right track! The best way to get started is – in my opinion – to look at the REST API examples here and try them for yourself. They even have an example on how to create a new page!

If you happen to like the Python programming language, I can recommend this module

Hope that helps to get you started,
  Oliver

Julia June 29, 2020

I've taken a look at those documents for the REST API in addition to this https://docs.atlassian.com/ConfluenceServer/rest/7.5.1/ and just am not sure about a couple of things.

Is "localhost:8080" the server that my company is using? If so, where would I be able to figure out which port to use?

0 votes
Davin Studer
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.
June 29, 2020

@Julia I guess the first question would be how familiar are you wil programming and using API's in general. Especially REST API's. If you are familiar with the process I would recommend getting the REST API Browser app from the marketplace. It is created by Atlassian and allows you to see the available rest API's. The one you want specifically is the "/rest/api/content/" end point. You want to do an http request to that API with a POST method using an authenticated user.

Julia June 29, 2020

To make the http request, would I be able to format the url like this:

http://confluence."mycompany".com/rest/api/content/

and is there some sort of authentication token I need? or is having the username and password enough of an authentication for the request.

Davin Studer
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.
June 29, 2020

If http://confluence."mycompany".com is how you access Confluence then yes.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events