hey, i’m developping a jira service management app using forge, iwanna call an external api that has the database api ,the forge logs shows
ERROR 2024-05-03T15:39:54.942Z f24c58f2-6eda-4d95-b070-50d7c32d4b03 Error fetching pages: { message: 'URL not included in the external fetch backend permissions: https://f4e3-41-250-195-224.ngrok-free.app/api/page. Visit go.atlassian.com/forge-egress for more information.', name: 'REQUEST_EGRESS_ALLOWLIST_ERR', status: 403 }
eventhough i already modified the manifest
modules:
jiraServiceManagement:portalFooter:
- key: jsm-chatbot-hello-world-panel
resource: main
resolver:
function: resolver
viewportSize: medium
function:
- key: resolver
handler: index.handler
resources:
- key: main
path: static/hello-world/build
app:
id: ari:cloud:ecosystem::app/880a5aaf-ccb0-4b00-86ba-d70ee500ed7a
permissions:
scopes:
- read:servicedesk-request
- read:page:confluence
- read:confluence-space.summary
- read:confluence-content.all
- read:confluence-content.summary
external:
fetch:
backend:
- 'https://f4e3-41-250-195-224.ngrok-free.app/api/page' ,
and this is my code
resolver.define('getPages', async () => {
try {
const res = await api.asApp().requestConfluence(
route`/wiki/rest/api/content?type=page&expand=body.view`,
{
headers: {
'Accept': 'application/json',
},
}
);
const data=await res.json();
const formattedPages = data.results.map(page => ({
id: page.id,
title: page.title,
content: page.body && page.body.view && page.body.view.value && page.title !== "Support" && page.title !== "Template - How-to guide" && page.title !== "Template - Troubleshooting article" && page.title !== "Getting started in Confluence" && page.title !== "Overview" ? formatHtmlToText(page.body.view.value) : ''
}));
const endpointUrl = 'https://f4e3-41-250-195-224.ngrok-free.app/api/page';
const response = await api.fetch(endpointUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formattedPages),
});
if (response.ok) {
console.log('Pages sent successfully to external endpoint for registration');
} else {
console.error('Failed to send pages to external endpoint:', response.statusText);
}
return formattedPages;
} catch (error) {
console.error('Error fetching pages:', error);
throw error;
}
});
// Function to format HTML content to plain text
const formatHtmlToText = (htmlContent) => {
return htmlToText(htmlContent) || "";
};
thank you in advance