We are building an app which uses OAuth to authorize the user’s Salesforce account and the use case is to push ticket attachments to the Salesforce.
As the app uses OAuth, we can only use $.request method for all the communications between the app and Salesforce. (the <%=access_token> only works in $.request method, it won’t work any other request packages).
We used the $.request method to push attachments (base64 converted) to the Salesforce and it was failed because of the payload size limitation as $.request method supports only up to 120KB. (attachments below 120KB successfully pushed to Salesforce)
Also, here we cannot use any other request npm packages to achieve the use case. So is there any possibilities to increase the $.request payload limit or please let us know on how to use the <access_token> in axios or unirest.
As per your understanding and findings, larger attachments cannot be loaded via the Request API feature of the platform.
Since OAuth is used in your app, the access token cannot be accessed via any other HTTP client libraries.
We have the payload restriction for security concerns. Let me convert it as a feedback and pass on to the platform engineering team to find the resolution for your use-case.
I believe the 120 KB limit is a platform restriction on $.request, so increasing it may not be possible from the app side. For larger attachments, a common approach is to upload the file through an external service or backend that handles the OAuth flow with Salesforce, then streams the attachment using the Salesforce REST API.
If you need to stay entirely within the Freshworks app, it would be helpful if the Freshworks team could clarify whether support for larger payloads or OAuth tokens in libraries like Axios is on the roadmap. I’m sure this would benefit many developers building Salesforce integrations