Forums

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

Error when registering a dynamic module

Paul S
Contributor
July 7, 2021

This is Node.js - I get an error 401 - "The request is not from a Connect app." when doing a POST request as follows:

const someMacro = {
dynamicContentMacros: [
{
key: 'somemacro',
name: {
value: 'Some Macro'
},
documentation: {
url: 'https://docs/...'
},
url: '/macro/some/some-macro.html',
bodyType: 'rich-text',
icon: {
width: 72,
height: 72,
url: '/icons/somemacro/somemacro.png'
},
cacheable: true,
description: {
value: 'Some Macro'
}
}
]
};

export async function doSomething(register: any): Promise<any> {
if (!register) {
return null;
}
return window.AP.request({
url: `/rest/atlassian-connect/1/app/module/dynamic`,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(someMacro)
}).catch(err => {
return err;
});
}

Which is as per https://developer.atlassian.com/cloud/confluence/rest/api-group-dynamic-modules/#api-atlassian-connect-1-app-module-dynamic-post

so what's wrong?!

 

1 answer

0 votes
marc -Collabello--Phase Locked-
Community Champion
July 7, 2021

@Paul SRegistering dynamic modules is only allowed for connect applications.  If your app is not installed in Confluence Cloud, you can't use that API.

Paul S
Contributor
July 8, 2021

Since the app IS installed in a cloud instance, what else could it be?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events