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

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events