Forums

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

Permission error (403) when attempting to update a page

Walter Warniaha
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!
June 30, 2022

I'm getting the following response when attempting to update the content on an existing page: https://seagate-systems.atlassian.net/wiki/rest/api/content/1069023297

{"statusCode":403,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.PermissionException: Could not update Content of type : class com.atlassian.confluence.pages.Page with id 1069023297"}

I get the body.storage.value from a GET (which succeeds):

I'm following the instructions from this page to update the contents:
payload:
{
    "version": {
        "number": 5
    },
    "title": "DAOS/CORTX S3 tests results page",
    "type": "page",
    "status": "current",
    "space": {
        "id": 458755,
        "key": "PUB"
    },
    "body": {
        "storage": {
            "value": "<content removed because of its size>",
            "representation": "storage"
        }
    }
}
Python code used to update page:
   updateheaders = {
      "Accept": "application/json",
      "Content-Type": "application/json",
      "Authorization": "<my email>:<token removed>"
   }
   response = requests.request("PUT", updateurl, data=payload, headers=updateheaders)
Its not clear in the docs as to which fields need to be updated.  I suspect body.storage.value is not correct, but I don't know what field(s) I should be setting with the content.
Any help would be appreciated,
Walter

1 answer

0 votes
Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2022

Hi @Walter Warniaha 

Welcome to the Atlassian Community!

By the error 403, I think the page itself might not be available for you to edit.
To quickly confirm that, can you check if the page is editable for you in the UI as well?

If you have no restrictions allowing you to edit, you may need to get in touch with your site-administrator to check if you can have the restrictions for this page in order to be able to edit it.

Other than that, the payload seems right, and if there was any issues with the body.storage value or something in the payload itself, it would probably return another error, such as 400 or 500 in this case.

For future cases and reference, you can check the errors and possible causes here in the official documentation, under responses:

We'll be looking forward to hearing from you!
Jessica

Walter Warniaha
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!
July 5, 2022

Hi Jessica

I created that page.  I tried editing it in the UI and I was able to edit it.  I'll check with the site admin.

Thanks,

Walter

Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2022

Thank you for letting me know, Walter!


If you have the permissions to the space and to the page restrictions (if there is any), then the 403 error message is weird, as generally it is the case.

Another test I'd suggest, would be creating a new page for you and restrict it only to you for testing purposes.
Use the same endpoint and body and changing only a few things in the payload, so you can update the page to see if that will work.

Another thing you might want to try, is removing the id in the space, the key should work without any issues there.

If you feel like it is needed to check the storage value, due to its size and the data in there, if you would like to share, but not with the public here, feel free to ask your site-admin to open a new ticket with us at https://support.atlassian.com/contact/
There we also should be able to check some other things with you in regards to the site itself, if needed.

Let us know if anything else happens and the behavior changes. :)

Cheers,
Jessica

Suggest an answer

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

Atlassian Community Events