I'm having trouble with using the AP.request method in the Javascript client.
I have created a Plugin which shows a custom page (general page) inside Jira.
From this page, I want to create a Confluence content page via the AP.request method of the Javascript client.
Working with the JIRA API via AP.request works fine, but when I try to call any method of the Confluence API it always fails with 403, no matter the endpoint I'm using.
Here is an example request that fails:
const data = {
title: "test",
"type": "page",
"space": {
"key": 'REL',
},
"body": {
"storage":{
"value": "<p>TEST TEST</p>",
"representation": "storage",
},
},
};
AP.request({
type: 'PUT',
contentType: 'application/json',
url: '/wiki/rest/api/content',
data: JSON.stringify(data),
success: (resp) => {
console.log(resp);
},
error: (xhr, status, err) => {
console.log(status);
},
});
What am I doing wrong here?
Do I need to specifically request a scope for Confluence in the addon descriptor?
Do I need to enable something in the settings?
Hi Christoph,
Create content: POST /rest/api/content
Kind Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.