Add attachment to a record from a REST Response

Giandonato
Tera Contributor

Hello everyone , 

i hope you can help me,

Basically I am trying to add an attachment to a record, via attachment API , then using the saveResposeBodyAsAttachment().
To retrieve the file, I use a REST call of type GET , which correctly returns me the file in byte stream , with http code 200.
The problem comes when I try to add it as an attachment via the method given above , it basically returns the error message I attach:
"Error : Unable to save response body as attachment: Request not sent to uri= "HIDDEN URL : java.net.UnknownHostException: proxy-aws.resources"

I also tried to make the call via Action from the flow designer , but I get the following as an error :
"Step Status: {
"code": 1,
"message": "Error encountered while creating Attachment. Record for file PRO_04_07042023_67573.pdf is not of required class."
}

Has anyone experienced similar problems?
Can you give me a possible solution?

Thank you in advance.

4 REPLIES 4

ersureshbe
Giga Sage
Giga Sage

Hi,

If you want to send as Binary file format, you should use AttachmentAPI.

If want to send as base64 format you should achieve via script. First ask to understand existing system supports binary or base64.  Use base64 in ECC queue table. Assuming ticket information and attachment both are maintained different table. Can you check you using correct table.

Regards,
Suresh.

Yes, 

but how can i insert my file in the request? because i have the file name , but the binary file is in an another REST Response body.

I tried saveResponseBodyAsAttachment , but it gave me an error.

 

mdshahvez11
Tera Contributor

If this problem of yours has been resolved , can you let me know the approach that you have tried for this?