getting json using example api confluence

Hi im trying to grab the json from the api call using a rest curl. here's my command

curl -D- -u admin:admin -X GET -H "Content-Type: application/json" http://localhost:8080/rest/api/2/configuration

I got this from here 

https://developer.atlassian.com/confdev/confluence-server-rest-api/confluence-rest-api-examples

and here's my output (replacing actual info with "hiding")

HTTP/1.1 200 

X-AREQUESTID: hiding

X-ASEN: hiding

Set-Cookie: hiding

X-Seraph-LoginReason: OK

Set-Cookie: hiding

X-ASESSIONID: hiding

X-AUSERNAME: hiding

Cache-Control: no-cache, no-store, no-transform

X-Content-Type-Options: nosniff

Content-Type: application/json;charset=UTF-8

Transfer-Encoding: chunked

Date: Thu, 20 Jul 2017 19:04:35 GMT



{"votingEnabled":true,"watchingEnabled":true,"unassignedIssuesAllowed":true,"subTasksEnabled":true,"issueLinkingEnabled":true,"timeTrackingEnabled":true,"attachmentsEnabled":false,"timeTrackingConfiguration":{"workingHoursPerDay":8.0,"workingDaysPerWeek":5.0,"timeFormat":"pretty","defaultUnit":"minute"}}

Now when I use a |python -mjson.tool  afterwards, it tells me no JSON object could be decoded. Its frustrating that the example isn’t working with the code, is there some way to grab the only the JSON at the end? Thanks for any help

 

1 answer

Dont use that "-D-" in you curl request. That will show you the header information which cant be decoded in json.

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

800 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you