I have a connect as backend. from connect using fetch api, i am using below api
let { appToken, apiBaseUrl } = await addon.getForgeAppToken(installationId);
const searchUrl = 'https://api.atlassian.com/ex/confluence/aaaaaaaa-bbb-cccc-a0ae-33ea5c8c9121/wiki/rest/api/content/search?cql=space in (‘Website’) and type=page and id = 2063204482&expand=body.view,body.atlas_doc_format,children.attachment'
let headers = {
Accept: 'application/json',
Authorization: `Bearer ${appToken}`
};
let apiRes = await fetch(searchUrl, { headers });
As seen appToken is retrieved from forgeSettings table and it is refreshed every hour by a request from forge. On my local instance this code works. however on another instance i do not get any results in the response. However the page does exists. out put i get is
{
results: [],
start: 0,
limit: 25,
size: 0,
_links: {
base: 'https://xyz.atlassian.net/wiki',
context: '/wiki',
self: 'https://xyz.atlassian.net/wiki/rest/api/content/search?expand=body.view%2Cbody.atlas_doc_format%2Cchildren.attachment&cql=space+in+%28%27Website%27%29+and+type%3Dpage+and+id+%3D+2063204482'
}
}
before this i was using connect framework and it was working correctly
const httpClient = addon.httpClient({ clientKey: clientKey, addonKey: addon.key });
const { apiBody } = await httpClientGetAsync(searchPath, httpClient);
What can be the resaon?
Thanks
Shiv