Forums

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

Internal Server error 500 when creating page with Confluence Rest api

Nauman Qureshi January 20, 2023

Hi,

i am trying to create a page in confluence using rest api but i am greeted with this error: {"statusCode":500,"message":"","reason":"Internal Server Error"}.

my code:

curl.exe -X POST -H "Authorization: Bearer PersonalAccessToken" -H "Content-Type: application/json" -d '{"type":"page","title":"new page","space":{"key":"TES"},"body":{"storage":{"value":"This is a new page","representation":"storage"}}}' https://myconfluenceurl.com/confluence/rest/api/content

i have checked the logs and found this aswell: 
org.codehaus.jackson.JsonParseException: Unexpected character ('t' (code 116)): was expecting double-quote to start field name

im not sure where the mistake is, i cant see it.

i appreciate every help!

Best Regards
Nauman

1 answer

0 votes
Vamsi Kandala
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.
January 20, 2023

Hi @Nauman Qureshi

Did you try using double quotes (") after -d instead of single quotes (')?

Thanks,
Vamsi

Nauman Qureshi January 20, 2023

Hey @Vamsi Kandala

yes i have tried doublequotes after -d. 
It still did not work.

Best Regards
Nauman 

Vamsi Kandala
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.
January 20, 2023

Hi @Nauman Qureshi

Hmmm...looks like there is an issue with JSON data format.  I have tested the JSON data you are sending and it is parsing fine as well as your curl call looks good to me.

Did you try using third-party tool like Postman and check?

Thanks,
Vamsi

Nauman Qureshi January 23, 2023

Hey @Vamsi Kandala unfortunately, i have not.
I am not sure how this will work.

Best Regards
Nauman

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence, marketing templates, confluence templates, marketing project management, content strategy, campaign planning, marketing collaboration, confluence for marketers, atlassian learning, marketing workflows, confluence best practices

5 must-use templates for Marketing teams (from a Confluence Marketer!) 👩🏻‍🎨

Who doesn’t love a good template? We sure do! Check out our top template picks for Marketing teams who want to streamline their processes, enhance collaboration, and take their marketing to new heights.

Read more 📚
AUG Leaders

Atlassian Community Events