Forums

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

Cloud API Create Page 403

Tim Gilmore
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!
May 6, 2019

I'm getting a 403 response when trying to create a page with the confluence cloud api. This was previously working, but suddenly I am getting the following response:

{
"statusCode": 403,
"data": {
"authorized": false,
"valid": true,
"errors": [],
"successful": false
},
"message": "Could not create content with type page"
}

I am making a POST request to https://<mydomain>.atlassian.net/wiki/rest/api/content/ using basic auth for a user that is able to create pages in this space through the UI (I've verified logging in with that username/pass, and am able to create a page in the space). Here is the body of my request:

{
"ancestors": [
{
"id": "602648"
}
],
"title": "Test",
"space": {
"key": "TOC"
},
"type": "page",
"body": {
"storage": {
"representation": "storage",
"value": "Test"
}
}
}

The ancestor ID is correct, as well as the space key. Is there something else I'm doing wrong? 

1 answer

1 accepted

0 votes
Answer accepted
SMS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2019

Hello Tim,

Thank you for reaching out! Happy to help.

Could you tell me how long ago this worked for you? We deprecated basic authentication as well as cookie-based in favor of API tokens, but it has been over a year since we made this change.

I would recommend that you generate the API token per the article above, and update your request to use it, and tell me if you continue to have the issue.

For information on how to replace it:

Use an API token

A primary use case for API tokens is to allow scripts to access REST APIs for Atlassian Cloud applications using HTTP basic authentication.

Depending on the details of the HTTP library you use, simply replace your password with the token. For example, when using curl, you could do something like this:

curl -v https://mysite.atlassian.net --user me@example.com:my-api-token

Note that me@example.com here is the email address for the Atlassian account you're using to create the token.

I hope that helps! Do let me know if you have any trouble.

Regards,

Shannon

Tim Gilmore
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!
May 8, 2019

Shannon,

Thank you very much for the help. This was working for us just a few weeks ago, but switching to an API token solved it.

Thanks again,

Tim

SMS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2019

Hi Tim,

Thank you for confirming. I was able to confirm now that the decision was made and the announcement was sent out over a year ago, but we didn't start removing it until a few weeks ago, in the 2nd week of April. That would explain why it didn't break for you until now. Terribly sorry for the confusion!

Glad to hear that you were able to resolve it by switching to the token.

Let me know if you run into any other issues or have any questions!

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events