Hi,
so I wanted to test out the Experimental JSM Forms Export APIs but got stuck.
Note: Forge UI Kit on “@forge/react”: “10.1.0” and nodejs18.x runtime.
My understanding is based on this tutorial: Exporting forms
Step 1: Start export API (resolver)
Step 2: Wait and check that export API finished (resolver)
That part works fine.
My question is Step 3: How to actually download the file for the user?
My assumption would be that I should return the exportId from the resolver to the frontend and provide the user a <Link>
component with the url of the Download export result API
But sadly this results in 401:
`{exportId && <Link openNewTab href={`https://api.atlassian.com/jira/forms/cloud/${cloudId}/export/${exportId}/export.xlsx`}>Download Export</Link>}`
And providing the URL as GET requests from the frontend also results in ‘failed to fetch’
const response = await requestJira(`/forms/export/${exportId}/export.xlsx`, {
headers: {
'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'X-ExperimentalApi': 'opt-in'
}
});