Issue with 403 Response on API Method Call in Custom Freshsales App

I am facing a 403 Forbidden response when attempting to make a method call to retrieve deal information. I find it puzzling that the same request works perfectly fine when executed as a cURL request.

Below, I’ve outlined the relevant details of the situation, including the code snippet from the app and the corresponding cURL request that is functioning correctly (Authorization token is dummy here)


            "path":"/crm/sales/api/deals/<%= context.dealId %>",
            "headers": {
                "Authorization": "Token token=nB8fcdaEnC3Fdsfh87",
                "Content-Type": "application/json"
curl -H "Authorization: Token token=nB8fcdaEnC3Fdsfh87" -H "Content-Type: application/json" -X GET ""

As you can see, the token used for authentication is identical in both the app’s code and the cURL request. Despite this, the app’s method call is returning a 403 Forbidden response, whereas the cURL request is successful in retrieving the expected data.

I have thoroughly verified the validity of the token and the endpoint, ruling out any issues related to their correctness. To troubleshoot further, I inspected the headers, request format, and even checked for potential differences in the request environment between the app and the cURL command. However, I have been unable to identify the root cause of this disparity.

I am reaching out to seek your expertise and guidance in resolving this issue. Your insights would be immensely valuable in helping me understand the underlying cause and finding a solution to ensure that our app’s method call can successfully retrieve deal information.

If there are any additional details or steps you would like me to take in order to diagnose this issue, please don’t hesitate to let me know. I am committed to resolving this matter promptly and appreciative of any assistance you can provide.