I am trying to upload/create an attachment to Coupa Invoice record from Power Automate using REST API. From [Coupa documentation][1], we have reference to create attachment using CURL.
The following example post creates an attachment of the file, Standard_Terms_Conditions.pdf, for the contract 12345.
curl -X POST
https:///api/requisitions/12345/attachments
-H "Accept: application/xml"
-H "content-type: multipart/form-data"
-H "x-coupa-api-key: "
-F "attachment[file]=@/Users/IntegrationAdmin/Contracts/Standard_Terms_Conditions.pdf"
-F "attachment[type]=file"
-F "attachment[intent]=Supplier"
I would like to create the attachment from Power Automate and reading the file content from an email/ OneDriveforBusiness. Any suggestions/ inputs on this would be really helpful.
I am using below format to upload the file. But things are moving as expected into the target system.
{ "file": { "intent": "invoice_attachment", "linked-to": { "type": "invoice_header", "id": "333072" }, "file": { "filename": "invoice.pdf", "content": "{base64(content)}" } } }