The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

confluence rest api to create a blog post with basic authentication

ProCARE Contractor
May 1, 2019

Hi,

I am using basic authentication to create a blog post through CURL and it was working before few days but suddenly somehow it stopped to work. 

Code:

curl -H "Authorization: Basic Y29udHJhY3RvckBwcm9jY" -X POST -H 'Content-Type: application/json;charset=utf-8' -d '{"type":"blogpost","title":"new blog post",
"space":{"key":"devops"},"body":{"storage":{"value":"test","representation":
"storage"}}}' https://localhost:8080/wiki/rest/api/content/

 

It is giving the error: {"statusCode":403,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"Could not create content with type blogpost"}

 

Please advise! Thanks in advance!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Zachary Miller
May 1, 2019

Hi @ProCARE Contractor 

The 403 error indicates that your account being used in basic auth no longer has the necessary permission to make a blog post. 

Please refer to https://confluence.atlassian.com/confcloud/assign-space-permissions-724764762.html for how to grant this user access to add blog posts to the space.

ProCARE Contractor
May 5, 2019

Hi Miller,

I've provided the all permission to individual user as described in above link, even though it fails. Also would like to inform that, It was working absolutely fine before few days.

Moreover, if i removed the "type" parameter then authentication turns into success.

Thanks

Zachary Miller
May 6, 2019
ProCARE Contractor
May 6, 2019

Hi Miller,

Yes, I am sure about the space key spelled correctly.

Thanks

TAGS
AUG Leaders

Atlassian Community Events