How to upload Freshdesk attachments to 3rd party application?

Hello,

I’m working with Freshdesk-Jira custom integration. In Freshdesk if any attachments exist then in response we will get as S3 links. These links are expiring after a few hours. So I decided to develop a middleware where I can download the file using that S3 link and upload it in Jira. But while doing this I’m getting timeout error in the logs. So I need to know is there any alternative to upload attachments from Freshdesk to Jira.

Below is the response I’m getting while doing this
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

Thanks,
Soujanya.

In Freshdesk Jira plus app I noticed that attachments are not uploading as expected from FD-Jira & Jira-FD.

Thanks,
Soujanya.

Hi Soujanya,

Regarding Jira Plus app -> The app only supports attachment sync from FD - Jira and the maximum attachment size is 10MB.

Regarding the error -> Make sure you call the renderData() method within 5secs.

5 Likes

Hi @kannansantharam,
I’m trying to upload attachments using my middleware. When I’m uploading ticket attachments I’m receiving attachment_url and I’m able to upload it successfully to my 3rd party application for the above URL.

Similarly, on conversation create if any attachments exist then I’m receiving URL differently and
while uploading this URL with the same middleware logic I’m receiving an error as
Server returned HTTP response code: 400 for URL and if I try to open the link in the browser it’s giving me an invalid request. Can you take this into consideration?

Thanks,
Soujanya.

Hello Soujanya,

Hope you are safe and doing well.

Based on your query, I would need some more clarification on the query here.

  • Since you mentioned response, is it the Freshdesk API response from which you are using the attachment URLs?
  • I could see timeout error from the screenshot. Is it a request to the middleware using Request API that got timed out? For the same, how long does the middleware take to process & respond?
  • You have mentioned Cannot set headers after they are sent to the client. Is this an error from your middleware?
  • We will also take the last query into consideration where you received 400. Is it possible for you to share the complete response for that particular request?

On a side note, please refrain from posting the attachment URLs in public forum. Since anyone will be able to access it if it’s still valid. :slight_smile:

Thanks.

2 Likes

Hi @raghuram.periaswamy,
Thanks for responding to this.

Yes, I’m using the attachment Url that when we hit get ticket detail API.

This issue got resolved.

It’s taking time to upload in my 3rd party application using middleware meanwhile request API renders data so I’m receiving this error however I resolved this too :slightly_smiling_face:.

Sure below is the response I’m getting

  `<Error><Code>InvalidRequest</Code><Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message<RequestId>61F6BEB2DA1C358B</RequestId><HostId>qVw3NknFZNKLvwV/1GnfI92GyiyGMMkCGDCwJPdpsIxCWkNEGiuNPX+BTro/PzDvLGJHyU73XA8</HostId></Error>`

-Soujanya.

Hello Soujanya,

We would need one more additional information regarding the conversation attachments. Are the attachment URLs that you are using obtained from the Freshdsek APIs or from the serverless events?

Thanks.

I’m using serverless events(i.e., on-conversation create event). My requirement here is to create a comment in 3rd party application on Freshdesk conversation create. If attachments exist I need to post attachments too.

-Soujanya.

Hello Soujanya,

This has been a known issue with the current event stream for conversation events. The same has been reported by other developers and will be fixed in the near future.

Thanks.

3 Likes

Hi @raghuram.periaswamy,

Hope you are doing well.
Just want to follow up if we have any update on this issue?

Thanks,
Soujanya.

Hello Soujanya,

This should have been fixed by now. Are you still facing the issue?

1 Like

Thanks, @raghuram.periaswamy, it working now :+1:.

3 Likes