Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create a new Confluence page with the basic curl example

Matt Cummings
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 29, 2020
curl -u 'MY_USERNAME:MY_API_TOKEN' -H 'Content-Type: application/json' -d "data=@path/home/matthew/conf.txt" 'https://MY_DOMAIN/wiki/rest/api/content'

with this input file:

{
"type": "page",
"title": "newpage",
"space": {
"key": "MY_SPACE_KEY"
},
"body": {
"storage": {
"value": "test",
"representation": "storage"
}
},
"version": 1
}

Returns this:

{"statusCode":500,"message":"org.codehaus.jackson.JsonParseException: Unexpected character ('d' (code 100)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: com.atlassian.plugins.rest.common.limitrequest.jersey.LimitingRequestFilter$1@18be5107; line: 1, column: 2]" 

 

I don't see what I'm doing wrong here. Any help is appreciated.

1 answer

0 votes
Matt Cummings
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 29, 2020

This was an encoding issue. I was able to make it work with 

-d "$(cat /home/matthew/conf.txt)" 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events