attachment resource type

Important: Currently all requests to API v2.0 must append $schemaversion=2.0 to the request URL to work properly. This is to uptake the new improved $metadata model avaliable from Business Central 17. An update will be applied shortly to apply the schemaversion automatically to API v2.0. For all other APIs $schemaversion=1.0 will be the default, unless specified in the request URL with $schemaversion=2.0. A solution is being worked on, where the schemaversion will be defined in the extension.

Represents an attachments in Dynamics 365 Business Central.

Note

For information about enabling APIs for Dynamics NAV see Enabling the APIs for Dynamics 365 Business Central.

Methods

Method Return Type Description
GET attachment attachment Gets a attachments object.
DELETE attachment none Deletes a attachments object.
POST attachment attachment Creates a attachments object.
PATCH attachment attachment Updates a attachments object.
Navigation Return Type Description
salesInvoice salesInvoice Gets the salesinvoice of the attachment.
journalLine journalLine Gets the journalline of the attachment.
generalLedgerEntry generalLedgerEntry Gets the generalledgerentry of the attachment.
salesOrder salesOrder Gets the salesorder of the attachment.
salesQuote salesQuote Gets the salesquote of the attachment.
salesCreditMemo salesCreditMemo Gets the salescreditmemo of the attachment.
purchaseInvoice purchaseInvoice Gets the purchaseinvoice of the attachment.
purchaseOrder purchaseOrder Gets the purchaseorder of the attachment.

Properties

Property Type Description
id GUID The unique ID of the attachments. Non-editable.
parentId GUID The ID of the parent entity.
fileName string Logical filename.
byteSize integer File size.
attachmentContent stream The attachment's content.
lastModifiedDateTime datetime The last datetime the attachments was modified. Read-Only.
parentType NAV.attachmentEntityBufferDocumentType The type of the parent document of the attachments. It can be " ", "Journal", "Sales Order", "Sales Quote", "Sales Credit Memo", "Sales Invoice" or "Purchase Invoice".

JSON representation

Here is a JSON representation of the attachment resource.

{
    "id": "GUID",
    "parentId": "GUID",
    "fileName": "string",
    "byteSize": "integer",
    "attachmentContent": "stream",
    "lastModifiedDateTime": "datetime",
    "parentType": "NAV.attachmentEntityBufferDocumentType"
}

See Also

GET attachment DELETE attachment POST attachment PATCH attachment