Attaching .wav audio file

Hi,
I’m trying to update the audio file .wav from freshcaller to freshservice ticket.while updating im only receiving a empty key pair and audio file does not reflect in the ticket.i have tried using FS method.as FS is not supported i have used request method.in request method the updated ticket response comes as emtpy array of objects.

    console.log("entered into update the attchment", transcripttext)
    let data = {};

    data["attachments[]"] = [{
        "value": request(recordedaudio),
        'options': {
            'filename': 'recording.wav',
        }

    }];
    console.log(data, "data in the attachmentsss")
    try {

        console.log(data, "final log data for setting thr attachment")

        $request.put(
            {
                headers: {
                    'Authorization': "Basic " + btoa(authInfo.fs_apikey),
                    'Content-Type': "multipart/form-data"
                },
                url: "https://" + authInfo.fs_domain + "/api/v2/tickets/" + ticketid,
                formData: JSON.stringify(data),
                staticIP: true,
            },

            function (error, response, body) {
                if (error) {
                    console.log(
                        "Failed to update attachment in the cloned ticket -->",
                        JSON.stringify(error)
                    );
                    renderData(error, null);
                }
                // renderData(null, { body });
                console.log("success", body, response);

            })

    }

    catch (err) {
        console.log(err, "error adding attachment")

    }

}```

the recorded audio passed to the request method is a s3 downloadable link.

![logs after updating the audio file|690x251](upload://fzzbqkOC9SCwZGnr8iGZDG8RjXI.png)



i have attached the logs after updating the audio file in freshservice ticket.

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