Hi Team,
I am working on an integration where I need to sync Freshservice conversation attachments to a third-party application.
When a conversation is created in Freshservice with an attachment, I am getting the attachment details along with the attachment ID
. request.json
“downloadFreshserviceAttachment”: {
“schema”: {
"method": "GET",
"host": "<%= iparam.domain %>",
"path": "/api/v2/attachments/<%= context.attachment_id %>",
"headers": {
"Authorization": "Basic <%= encode(iparam.api_key) %>"
}
}
}
My requirement is:
Freshservice Conversation → Attachment → Download file → Upload file to third party
For example, if I attach a PNG image to a conversation, I need to download that PNG file and then upload the same file to the third-party application.
I tried using the attachment ID to download the file. However, when I try to download the attachment, I get an error like:
Unsupported Content-Type
Because I am unable to download the actual file, I cannot pass the file to the file upload API (files).
I am also trying to use the FDK request template file upload functionality. My plan is to upload the downloaded file first, get the upload response/ID, and then pass that ID to the third-party API using invokeTemplate.
The expected flow is:
Freshservice Conversation
→ Get attachment ID/URL
→ Download actual attachment file
→ Upload file
→ Get uploaded file ID
→ Send file ID to third-party API using invokeTemplate
But currently I am stuck at the download attachment step because of the Unsupported Content-Type error.
Error:
Failed to download Screenshot (162).png from Freshservice: {
status: 415,
headers: {},
response: ‘Unsupported content type’,
errorSource: ‘APP’,
attempts: 1
}
I have tested this with a PNG image attachment, but I am getting the Unsupported Content-Type error.
Please let me know the recommended approach for downloading and uploading Freshservice conversation attachments to a third-party application.
Thanks!