CORS error when fetch internal attachment using attachment.contentUrl()
Hi everyone,
I have an attachment on internal note and I want to fetch it from my custom app.
I was trying to use comment.attachments() to get the attachment file from the comment, however it doesn't return the real File, it's just return the details of the attached file (like filename, contentType, contentUrl, thumbnailUrl, and token).
So I am thinking to create a new File by making a new blob from attachment.contentUrl(), but I can't get it due to CORS error when I am trying to get the attached file using the fetch function.
This is my code:
this.ticketObj = await parentClient.get('ticket')const attachmentObject = this.ticketObj.ticket.comment.attachmentsconst blobFile = await fetch(attachmentObject[0].contentUrl).then(r => r.blob()) // I got CORS error on this lineconst uploadFile = new File([blobFile], attachmentObject[0].filena