We are working on a ticket to move attachment in public notes in FS to ticket created in FD. We were successfully upload attachment & image to S3 from FS but facing issues while stream and attach it to newly created FD ticket.
Here is the community topic what we referred and tried
Creating tickets with attachments using serverless apps - FAQs - Freshworks Developer Community
Here is the code
var fields = {
‘email’: ‘email@yourdomain.com’,
‘subject’: ‘Ticket subject’,
‘description’: ‘Ticket description.’,
‘status’: 2,
‘priority’: 1
}
var headers = {
‘Authorization’: auth,
‘Content-Type’:‘multipart/form-data’
}
unirest.post(URL)
.headers(headers)
.field(fields)
.attach(‘attachments’, ‘https://i.imgur.com/lcB62xb.jpg’)
.attach(‘attachments’, ‘https://gist.githubusercontent.com/hemchander23/6708ad5595dd56ef31087d47d4f96a44/raw/89ab0df9685cac94bbb88e1ebfd3655bcade6c9d/DarkS1E4_Script.txt#’)
.attach(‘attachments’, ‘https://s3.amazonaws.com/cdn.freshservice.com/data/helpdesk/attachments/production/15012576518/original/attchmentforaws.txt?X-Amz-Algorithm=algo&X-Amz-Credential=credential%2F20200804%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200804T062727Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=sign’)
.end(function(response){
// console.log(response);
console.log(response.body)
console.log("Response Status : " + response.status)
// if(response.status == 201){
// console.log("Location Header : "+ response.headers[‘location’])
// }
// else{
// console.log(“X-Request-Id :” + response.headers[‘x-request-id’]);
// }
});
Here is the attachment moving from FS to FD
I guess, system fails reading the file path url
Note : I have modified Algorithm, Credentials and Signature, fyi.
Need your help to attach file and images from s3 to ticket.
Thanks!