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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Not able to Create a new confluence page as a child of another page

Not able to Create a new confluence page as a child of another page with below curl req:

curl -u admin:admin -X POST -H 'Content-Type:application/json' -d '{"type":"page","title":"new page",
"ancestors":[{"id":456}], "space":{"key":"TST"},"body":{"storage":{"value":
"<p>This is a new page</p>","representation":"storage"}}}'
https://wiki/rest/api/content/

OS: Windows

Error on using -o with curl:

curl: (7) Failed to connect to port 80: Connection refused

1 answer

0 votes

The error you're getting is a network error - it means there is nothing running on port 80 (http) on the url you are hitting, or a firewall is stopping the connection dead.

Check what the base url of the Confluence you are trying to connect to is, I suspect you will find it is not what you are using in curl (it will probably be https)

Yes, I have mentioned in my question. It is https only.

But your curl call is over the default http port of 80.  Have you set up 80 to serve up https?  Or are you looking in the wrong place?

curl -D- \
  -u admin:admin \
  -X POST \
  -H "X-Atlassian-Token: nocheck" \
  -F "file=@example.txt" \
  -F "minorEdit=true" \
  -F "comment=Example attachment comment" \
  https://wiki/rest/api/content//123/child/attachment

But I am getting status 200 for the above curl request. 

A 200 is a success, now you're on the right url.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

125 views 0 3
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you