@SagnikS7 There are actually two service calls neccesary with the OOTB api (v1).
The first call is used to upload the file to the Pega database/repository. This is the attachments/upload. The requestbody for tthis service is empty, instead it uses form-data with a content key in it. This will contain the base64 encoded string.
Here is an example in Postman:
A success response should return an AttachmentID of the newly created Data-WorkAttachFile-Temp object.
The second call is to link the uploaded attachment to a case. You can use the cases/attachments service for this.
The resource parameters contains the CaseID of the case you want to link the uploaded attachment to. In the body you provide the AttachmentID that was returned in the first service call.
After this, the attachment is linked to the case (Link-Attachment instance is created) and the Data-WorkAttachFile-Temp object is now a Data-WorkAttachFileobject.
@SergeS84 Hi, I have a question with the 2nd call specifically..
Was able to successfully call 1st API and create the Data-WorkAttach-File-Temp and when we call the 2nd api it returns a 201 created result (empty response body) and the temp file is now a Data-WorkAttach-File with a Link-Attachment as well. however, the file is not showing up in the case as an attached file but in the Link-Attachment instance it pxLinkedRefTo points to the case.
Also, when using the API that retrieves attachments of case, it also doesn't get returned.
Any idea regarding this?