@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.