documents resource type

Represents a Lease Contract or Work Order documents in SOFT4Spaces.

Note

For information about enabling APIs for Business Central see Overview.

 

 

API endpoint

 

API Path
documents https://{{businesscentralPrefix}}/{{APIGroup}}/{{version}}/companies({{companyId}})/documents

 

Methods

 

Method Return Type Description
GET documents document Gets a document object.
DELETE documents none Deletes a document object.
POST documents document Creates a document object.
PATCH documents document Updates a document object.

 

GET documents

Description

Retrieves an existing documents records from Business Central.

HTTP Request

GET

https://{{businesscentralPrefix}}/api/{{publisher}}/{{group}}/{{version}}/companies({{companyId}})/documents

Request Headers

Header Value
Authorization NTLM, OAuth2. Required.
Accept application/json

Request Body

None.

Response

Returns a 200 OK status code and JSON object representing the lease contracts records.

Example Response

JSON

{

           "id": "0e440a96-7a02-ed11-82f8-0022489ab003",

           "entryNo": 2,

           "tableId": 17028870,

           "customerNo": "",

           "leaseContractNo": "NS0007",

           "leaseContractVersionNo": 1,

           "vendorNo": "",

           "workOrderNo": "",

           "description": "",

           "comment": "",

           "documentDate": "2022-07-13",

           "documentTypeCode": "IMPORT",

           "templateCode": "PDF",

           "prepared": false,

           "preparedMarkBy": "",

           "preparedMarkDateTime": "0001-01-01T00:00:00Z",

           "signed": false,

           "signedMarkBy": "",

           "signedMarkDateTime": "0001-01-01T00:00:00Z",

           "checked": false,

           "checkedMarkBy": "",

           "checkedMarkDateTime": "0001-01-01T00:00:00Z",

           "docSendTo": "_x0020_",

           "docSendToNo": "",

           "docSendToName": "",

           "docSendToContPersonNo": "",

           "sentByEmail": false,

           "doNotSend": false,

           "email": "",

           "subject": "",

           "deliveryStatus": "",

           "salutation": "",

           "attachmentNo": 0,

           "crossRefToDocuments": 0,

           "checkedByLawyer": false,

           "checkedByLawyerMarkBy": "",

           "checkedByLawyerMarkDate": "0001-01-01T00:00:00Z",

           "fileExtension": "",

           "fileName": "",

           "craetedBy": "_x0020_",

           "systemCreatedAt": "2022-07-13T07:08:31.98Z",

           "systemCreatedBy": "42d90890-d6b0-46c5-ae00-bea077ea6604",

           "systemModifiedAt": "2022-07-13T07:08:31.98Z",

           "systemModifiedBy": "42d90890-d6b0-46c5-ae00-bea077ea6604",

           "blobText": ""

       }

 

POST documents

Description

Creates a new document in Business Central.

HTTP Request

POST

https://{{businesscentralPrefix}}/api/{{publisher}}/{{group}}/{{version}}/companies({{companyId}})/documents

Request Headers

Header Value
Authorization NTLM, OAuth2. Required.
Accept application/json

Request Body

Provide a JSON object with document data.

JSON

{
           "tableId": 17028870,
           "customerNo": "",
           "leaseContractNo": "NS0007",
           "leaseContractVersionNo": 1,
           "vendorNo": "",
           "workOrderNo": "",
           "description": "",
           "comment": "",
           "documentDate": "2026-03-13",
           "blobText" : "iVBORw0KGgoAAAANSUhEUgAAAH0AAABMCAIAAADPxC96AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7"
}

Response

Returns a 201 Created status code and the created document object.

 

PATCH documents

Description

Updates existing document in Business Central.

HTTP Request

PATCH

https://{{businesscentralPrefix}}/api/{{publisher}}/{{group}}/{{version}}/companies({{companyId}})/documents({{documents_id}})

Request Headers

Header Value
Authorization NTLM, OAuth2. Required.
Accept application/json

Request Body

Provide the fields to be updated of document in Business Central.

JSON

{    
   "documentTypeCode": "AGREEMENT",
   "description": "Agreement 011",
   "prepared": true,
   "preparedMarkBy": "USER",
   "preparedMarkDateTime": "2026-04-09T12:56:24.867Z",
   "signed": true,
   "signedMarkBy": "USER",
   "signedMarkDateTime": "2026-04-09T12:56:26.017Z"
}

Response

Returns a 200 OK status code.

 

Properties

 

Property Type Description
id GUID The unique ID of the lease contract. Non-editable.
entryNo integer Specifies the number of the document. This value is generated during entry creation.
tableId integer Specifies the table number to which the document is related. There are two options: Lease Contract 17028870 or Work Order 17028970.
customerNo string Specifies customer number.
leaseContractNo string Specifies the lease contract number.
leaseContractVersionNo integer Specifies the lease contract version number.
vendorNo string Specifies vendor number.
workOrderNo string Specifies work order number.
description string The document's description.
comment string Specifies the comment value.
documentDate date Specifies the document date.
documentTypeCode string Specifies the document type code.
templateCode string Specifies the document's template code.
prepared boolean Specifies the “Prepared” mark value.
preparedMarkBy string Specifies the user GUID which marked “Prepared”.
preparedMarkDateTime datetime Specifies the datetime when “Prepare” was marked. 
signed boolean Specifies the “Signed” mark value.
signedMarkBy string Specifies the user GUID which marked “Signed”.
signedMarkDateTime datetime Specifies the datetime when “Signed” was marked. 
checked boolean Specifies the “Checked” mark value.
checkedMarkBy string Specifies the user GUID which marked “Checked”.
checkedMarkDateTime datetime Specifies the datetime when “Checked” was marked. 
docSendTo string Specifies Doc. to send to the option value: Customer or Third Party.
docSendToNo string Specifies the customer number if the document is sent to the customer.
docSendToName string Specifies the customer name if the document is sent to the customer.
docSendToContPersonNo string Specifies the contact number if email is sent to contact.
sentByEmail boolean Specifies the “Sent by Email” mark value.
doNotSend boolean Specifies the “Do not Send” mark value.
email string Specifies the email.
subject string Specifies subject value.
deliveryStatus string Specifies email delivery status.
salutation string Specifies the salutation of the letter.
attachmentNo integer Specifies the attachment identification number in the system.
crossRefToDocuments integer Specifies the number of the related documents depending on document type, customer no., and table ID.
checkedByLawyer boolean Specifies the “Checked by Lawyer” mark value.
checkedByLawyerMarkBy string Specifies the user GUID which marked “Checked by Lawyer”.
checkedByLawyerMarkDate datetime Specifies the datetime when “Checked by Lawyer” was marked. 
fileExtension string Specifies the file extension.
fileName string Specifies the file name with an extension.
createdBy GUID The ID of the user who created the lease contract.
systemCreatedAt datetime The datetime the document was created. 
systemCreatedBy GUID The ID of the user who created the document.
systemModifiedAt datetime The last datetime the document was modified. 
systemModifiedBy GUID The ID of the user who last modified the document.
blobText string Specifies the file content in Base64 format.

 

JSON Representation 

{

           "id": GUID,

           "entryNo": integer,

           "tableId": integer,

           "customerNo": string,

           "leaseContractNo": string,

           "leaseContractVersionNo": integer,

           "vendorNo": string,

           "workOrderNo":string,

           "description": string,

           "comment": string,

           "documentDate": date,

           "documentTyoeCode": string,

           "templateCode": string,

           "prepared": boolean,

           "preparedMarkBy": GUID,

           "preparedMarkDateTime": datetime,

           "signed": boolean,

           "signedMarkBy": GUID,

           "signedMarkDateTime": datetime,

           "checked": boolean,

           "checkedMarkBy": string,

           "checkedMarkDateTime": datetime,

           "docSendTo": string,

           "docSendToNo": string,

           "docSendToName": string,

           "docSendToContPersonNo": string,

           "sentByEmail": boolean,

           "doNotSend": boolean,

           "email": string,

           "subject": string,

           "deliveryStatus": string,

           "salutation": string,

           "attachmentNo": integer,

           "crossRefToDocuments": integer,

           "checkedByLawyer": boolean,

           "checkedByLawyerMarkBy": GUID,

           "checkedByLawyerMarkDate": datetime,

           "fileExtension": string,

           "fileName": string,

           "craetedBy": GUID,

           "systemCreatedAt": datetime",

           "systemCreatedBy": GUID,

           "systemModifiedAt": datetime,

           "systemModifiedBy": GUID,

           "blobText": string

}