document template resource type

Represents a Document Templates in SOFT4Spaces.

Note

For information about enabling APIs for Business Central see Overview.

 

 

API endpoint

 

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

 

Methods

 

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

 

GET documentTemplates

Description

Retrieves an existing document templates records from Business Central.

HTTP Request

GET

https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentTemplates

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 document templates records.

Example Response

JSON

{
           "id": "fc0c674a-c32d-f111-97eb-b7257c52c8db",
           "documentTypeCode": "NEW",
           "templateCode": "1",
           "description": "First",
           "validFrom": "0001-01-01",
           "validUntil": "0001-01-01",
           "customReportLayoutCode": "",
           "noOfDocuments": 1,
           "attachmenNo": 0,
           "templateForInvoice": false,
           "remarks": “”
  }

 

GET documentTemplates

Description

Retrieves an existing document templates records from Business Central.

HTTP Request

GET

https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentTemplates({{documentTemplates_id}})

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 document template record.

Example Response

JSON

{
           "id": "fc0c674a-c32d-f111-97eb-b7257c52c8db",
           "documentTypeCode": "NEW",
           "templateCode": "1",
           "description": "First",
           "validFrom": "0001-01-01",
           "validUntil": "0001-01-01",
           "customReportLayoutCode": "",
           "noOfDocuments": 1,
           "attachmenNo": 0,
           "remarks": “”
  }

 

 

POST documentTemplates

Description

Creates a new document template in Business Central.

HTTP Request

POST

https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentTemplates

Request Headers

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

Request Body

Provide a JSON object with document template data.

JSON

{
           "documentTypeCode": "NEW",
           "templateCode": "1",
           "description": "First",
           "validFrom": "2026-01-01",
           "validUntil": "2030-01-01"
}

Response

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

 

PATCH documentTemplates

Description

Updates existing document templates in Business Central.

HTTP Request

PATCH

https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentTemplates({{documentTemplates_id}})

Request Headers

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

Request Body

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

JSON

{
           "description": "First",
           "validFrom": "2026-01-01",
           "validUntil": "2026-12-31"
}

Response

Returns a 200 OK status code.

 

Properties

 

Property Type Description
id GUID The unique ID of the lease contract. Non-editable.
documentTypeCode string Specifies the document type code. Part of the unique identifier of the record.
templateCode string Specifies the document template code. Part of the unique identifier of the record.
description string Specifies the description value.
validFrom date Specifies the date when the document template becomes valid.
validUntil date Specifies the date till when the document template is valid.
customReportLayoutCode string Specifies custom report layout code.
noOfDocuments integer Specifies number of documents with a particular document template.
attachmenNo integer The customer's Specifies the attachment identification number in the system..
remarks string Specifies the remarks.

 

JSON Representation

{
           "id": GUID,
           "documentTypeCode": string,
           "templateCode": string,
           "description": string,
           "validFrom": date,
           "validUntil": date,
           "customReportLayoutCode": string,
           "noOfDocuments": integer,
           "attachmenNo": integer,
           "remarks": string
}