Is it possible to request Confluence API?

I coded according to this manual(https://developer.atlassian.com/platform/forge/automate-jira-using-triggers/).
Then, I added the below code to request Confluence API.

const response2 = await api.asUser().requestConfluence(route`/wiki/api/v2/pages/196641`, {
		headers: {
		  'Accept': 'application/json'
		}
	  });
	
	console.log(`Response: ${response2.status} ${response2.statusText}`);

But the error happens.

ERROR   17:24:33.572  67c48395-e248-486b-b87f-df878fcf32cd  PROXY_ERR: Forge platform failed to process runtime HTTP request - 401 - AUTH_TYPE_UNAVAILABLE
    at handleProxyResponseErrors (webpack://product-trigger/node_modules/@forge/api/out/api/fetch.js:84:1)
    at <anonymous> (webpack://product-trigger/node_modules/@forge/api/out/api/fetch.js:29:1)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.run (webpack://product-trigger/src/index.jsx:8:1)
    at async r.<computed> (C:\Users\462184~1\AppData\Local\Temp\tunnel-16832-OCDQAlbbxyxq\index.cjs:2:139869)
    at async process.<anonymous> (C:\Users\462184760\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\tunnel\out\sandbox\sandbox-runner.js:7:20) {
  status: 401,
  errorCode: 'AUTH_TYPE_UNAVAILABLE'
}

I think I setted the correct scopes.

permissions:
  scopes:
    - read:jira-work
    - write:jira-work
    - read:confluence-content.all
    - read:confluence-content.summary
    - read:confluence-props
    - search:confluence
    - read:confluence-content.permission

If someone can resolve it, please help me.
Thank you.

Welcome to the Atlassian developer community @HayataKobayashi,

You can find the answer in this blog post:

There are 2 critical notes from that article about cross-product apps:

  1. Cross product apps must be installed in all of the products they interact with. The app we’ll create in this tutorial needs to be installed in Jira and Confluence tenants that belong to the same site.
  2. Cross product apps are not supported by Atlassian Marketplace. This limitation is due to the need to install in multiple products. If you intend to commercialize your multi-product app, see the workaround listed here.
1 Like