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!
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If http://confluence."mycompany".com is how you access Confluence then yes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.