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

REST API Create Page

Pavel April 30, 2015

Try to create a new Page but ufortunantely for me there is an error 505:

C:\Users\Administrator>curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","space":{"key":"TSTSPAC"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://MyServerIP/confluence/rest/api/content/ | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0curl: (6) Could not resolve host: application
100   192    0    72  100   120    923   1538 --:--:-- --:--:-- --:--:--  1538
{
    "statusCode": 500,
    "message": "javax.ws.rs.WebApplicationException: null"
}

 

Is it syntax problem or some permissions error ? All requerable params for permissions and remote API are ON.

Need your help

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Amitrajit Chatterjee May 4, 2015

Hi, Where you able to fix the issue? I'm getting the same error.

0 votes
Joseph Clark April 30, 2015

On Windows, I don't think you can escape double-quotes within single quotes - according to this StsckOverflow article, you need to use ^" or "" to escape a double-quote character.

 

TAGS
AUG Leaders

Atlassian Community Events