Hi, I am trying to create a flow to get an attachment from a Sales Order record in Business Central using the HTTP premium connector following this doc:
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_attachment_get
I tried using this URI
Results:
You must specify a parentId in the request body. CorrelationId: 1f77a56c-ca65-4708-9596-88f42eece818.
Then, I tried adding a parentId:
api.businesscentral.dynamics.com/.../"Environment Name"/api/v2.0/companies("Company GUID")/attachments?$filter=parentId eq "Sales Order GUID"
Results:
You must specify a document id and a document type to get the attachments. CorrelationId: 53c5101e-c8e4-402b-a084-f143326a843c.
I added the document type:
api.businesscentral.dynamics.com/.../"Environment Name"/api/v2.0/companies("Company GUID")/attachments?$filter=parentId eq "Sales Order GUID" and parentType eq salesOrder
Results:
A binary operator with incompatible types was detected. Found operand types 'Microsoft.NAV.attachmentEntityBufferDocumentType' and 'Microsoft.NAV.salesOrder' for operator kind 'Equal'. CorrelationId: e9233a17-266e-4816-bd41-3a4d437c7a14.
This is the only one that does get a "200 Status code" but the results are blank:
api.businesscentral.dynamics.com/.../"Environment Name"/api/v2.0/companies("Company GUID")/salesOrders("Sales Order GUID")/attachments
I have double-checked and the sales order record does have an attachment (PDF) linked.
I have also tried using the "Get File, Image, Document V3" connector for Business Central but I am not able to retrieve it from Sales Order, it does work for "Posted Sales Invoices"
So the question is, is it possible? and if so, what should the URI look like?
Thanks in advance for any suggestions.