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"
}
}
}
}'
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.