Hello all, I am having an issue with placing a footer comment using the confluence API.
I keep getting errors saying {code: 401, message: ‘Unauthorized; scope does not match’}, but I have been following the documentation (https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-comment/#api-footer-comments-post) and have tried uninstalling and reinstalling, using forge install --upgrade, and many more things to attempt to get the comments to work. I messed around with the update comment function, and it did not throw an error for permissions.
I also tried adding version in case it wanted me to increment a version number, but that did not fix the problem.
Anyone else experience this before or have API comments working currently?
Here are my permissions from the yml:
scopes:
- storage:app
- read:content:confluence
- read:confluence-content.summary
- write:confluence-content
- read:jira-work
- manage:jira-configuration
- read:page:confluence
- write:page:confluence
- write:comment:confluence
Here is my backend API call:
async submitComment(pageId, decision, comment, approverName){
const bodyData = JSON.stringify({
pageId: pageId,
body: {
representation: "storage",
value: comment
},
})
const response = await api.asApp().requestConfluence(route`/wiki/api/v2/footer-comments`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
return await response.json()
}
}