We manipulate purchase data in Dynamics 365 BC using API to update, receive and invoice PO lines. (Dynamics 365 Plugin parse Note attachment XML without using file) We now want to upload an invoice document as an attachment to purchase invoice and add/update attachment notes using API. We did not find any documented API to do that.
We've looked at the attachement API https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_attachment but it never return values:
Call example: {{baseUrl}}/companies({{companyId}})/attachments?$filter=parentId eq bf4eb7ea-d558-ec11-bb7c-000d3a2b9aee and parentType eq 'Purchase Invoice'
Always returns:
{
"@odata.context": "api.businesscentral.dynamics.com/.../$metadata
"value": []
}
but this Purchase Invoice is valid and has attachment (not found in attachment table but in 'Document Attachment' table) And no idea on how to get 'Attachment Notes'
Any suggestion would be greatly appreciated ! Thanks, Vincent