Payload Too Large Error for tickets with many images/replies

I manage a front-end application that gets ticket and conversation data from Freshdesk and sends it via API to another application. It works 99% of the time, but in some instances with larger conversations, it does not send. When running it locally I get an error:
PayloadTooLargeError: request entity too large

And in the Network tab it looks like:

Request URL: http://localhost:10001/dprouter?product=freshdesk 
Request Method: POST 
Status Code: 413 Payload Too Large
Referrer Policy: strict-origin-when-cross-origin

The request I am running looks like below and I get a 200 but the response is blank:


"getTicketConversation": {
        "schema": {
            "protocol": "https",
            "method": "GET",
            "host": "<%= iparam.subdomain %>.freshdesk.com",
            "path": "/api/v2/tickets/<%= context.query %>/conversations?page=<%= context.page %>",
            "headers": {
                "Authorization": "Basic <%= encode(iparam.api_key) %>",
                "Content-Type": "application/json"
            }
           
        }
    }

Is this due to a package that the FDK is using? Any tips on where this error might be originating from would be helpful. I saw this post but it seems to be related to serverless apps and not frontend apps.

Hello @Alex_Degregori ,

Greetings!

It appears that you’ve been attempting to fetch conversations to extract attachments, and this issue may occur when the conversation size exceeds a certain limit.

Please note that there is a 6MB hard limit on the response size for requests.

I hope this post helps: reference.

By default, 30 objects are returned per page, but you can adjust this by adding the per_page parameter to the query.

In this case, you can reduce the data per page, but please be mindful of the rate limits.

Hope this helps.

Thanks,
Anish S

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.