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

Accessing Confluence Server with API

dmx October 30, 2019

I am new to Confluence and just joined my company for few months. My company hosts Confluence and JIRA in the local server with Google G-suit account oAuth. In that case, how I can access the company confluence through REST api? 

I tried the following command, but shows connection refused

```curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?type=blogpost&start=0 &limit=10&expand=space,history,body.view,metadata.labels" | python -mjson.tool```

 

I guess I need to replace the admin:admin with my username and password. My company Confluence uses G-suit account oAuth, so I need to replace the admin:admin with my G-suit account username and password?

1 answer

1 accepted

0 votes
Answer accepted
Stephen Crandell
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.
October 30, 2019

Yes, you have to use a username and password that has access to Confluence. Also, you need to make sure the domain is correct and you shouldn't need the port. So, if your companies url to Confluence is mybigcompany.com then that is all you need then add the "/rest/api..." so , it would be something like this:

curl -u <username>:<passowrd>-X GET "http://mybigcompany.com/rest/api/content?type=blogpost&start=0 &limit=10&expand=space,history,body.view,metadata.labels" | python -mjson.tool

 

Good Reference material for Confluence Server 7.0.3, change the link to whatever version of Confluence your company is running: https://docs.atlassian.com/ConfluenceServer/rest/7.0.3/

dmx October 30, 2019

It works. Thank you Stephen for your help. I still have one question about the authentication. Is it possible to authenticate the get request with the google oauth since my company use google G-suit account to authenticate?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events