Forums

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

403 forbidden error when attempting to create a page via the REST API

Stevie Hollard
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 28, 2022

Below is the request that I'm sending via postman and it keeps coming back with a forbidden error. When I send the request I am filling in the email and token sections. I have access to create a page within the space

curl --request POST \
--url 'https://nightingalesoftware.atlassian.net/wiki/rest/api/content' \
--user 'user@example.com:user_api_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"title": "Test Editor v2 Page from API",
"type": "page",
"space": {
"key": "SPC"
},
"status": "current",
"ancestors": [
{
"id": "987654321"
}
],
"body": {
"storage": {
"value": "<h1> Test content </h1>",
"representation": "storage"
}
},
"metadata": {
"properties":{
"editor": {
"value": "v2"
}
}
}
}'

 

1 answer

0 votes
Chu Dam
Community Champion
June 28, 2022

Hi @Stevie Hollard 

It looks like you are not authenticated properly... 

As the doc mention here: https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-wiki-rest-api-content-post

--header 'Authorization: Bearer <access_token>'

The access token should be in the header of your post request... If you build the proper request as the doc explains it should work all fine ;) 

I hope this helps.

Cheers,
Dam. 

Suggest an answer

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

Atlassian Community Events