Request Method Returning Incomplete Response (Attempts)

Hello, I’m developing a Freshdesk app and am in need of support. My issue is similar to the one experienced by the author of the post over here: Incomplete response from Google Sheets API

I’m using the FDK request method to make a post request to an internal web service. Unfortunately and unexpectedly, I’m hitting the success callback with an incomplete response, an object with only an attempts property and a value of 1. {attempts: 1}.

My request looks like this:

client.request.post( `${baseURL}/${path}`, {
    headers: { 
        "X-sharedsecret": secret,
        "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
    maxAttempts: 5
}).then(
    (envelope) => {
        console.log("Response from API", path, body, envelope)
        if(envelope.hasOwnProperty("response")){
            try{
                let data = JSON.parse(envelope.response);
                resolve(data);
            }catch(error){
                resolve(envelope.response);
            }
        }else{
            reject("Malformed response from FDK request proxy")
        }
    }, 
    reject
);

I always see the success path with the logged response, but the response is incomplete as noted above, and as far as I can tell, the request never hits my API.

Ok, so the super-cut issue is probably that your API is responding with an envelope.response of greater than 256 KB in size which our backend request service hosted on AWS Lambda cannot propagate forward due to Lambda invocation limits.

The suggestion for now since its a frontend invocation is to use fetch or axios

We discovered this issue a few weeks back and our documentation is yet to reflect these limits. Also, the engineering team has a chore task of propagating the error properly. Hope this sheds some light on this ambiguity.

cc: @Raviraj @Saif

1 Like

Thanks for the quick reply.

While that’s a good piece of information, and something I’ll definitely keep in mind, I believe my issue must be something else. The response from my api for the call I’m making is a two byte string, just {}, an empty json object.

As for using axios, I may have to go down that path, but I was hoping to use the FDK request method on account of the secure installation parameters letting me hide the authorization secret. The API I’m using is designed to be used from back-ends, so the FDK request method presents me an interesting secure workaround, if only it worked :slight_smile:

Please advise.

1 Like

Hi @Derek_Brown,

If this is simply a 2-byte string this limitation shouldn’t apply. One of the things that can help us make progress is by looking into the logs.

See how fdk.log helps in troubleshooting

Copy specific section of logs using Debug Mode

Share browser logs if you think those can help.

Appreciate the details you’ve shared as you seek for help. :slight_smile: