Represents a Document Types in SOFT4Spaces.
Note
For information about enabling APIs for Business Central see Overview.
API endpoint
| API | Path |
| documentType | https://{{businesscentralPrefix}}/{{APIGroup}}/{{version}}/companies({{companyId}})/documentType |
Methods
| Method | Return Type | Description |
| GET documentType | documentType | Gets a document type object. |
| DELETE documentType | none | Deletes a document type object. |
| POST documentType | documentType | Creates a document type object. |
| PATCH documentType | documentType | Updates a document type object. |
GET documentType
Description
Retrieves an existing document type records from Business Central.
HTTP Request
GET
https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentType
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 type record.
Example Response
JSON
|
{ "id": "035fee42-c32d-f111-97eb-b7257c52c8db", "documentTypeCode": "NEW", "description": "New Type", "templates": 1, "documents": 1 } |
GET documentType
Description
Retrieves an existing document type record from Business Central.
HTTP Request
GET
https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentType({{documentType_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 type record.
Example Response
JSON
|
{ "id": "035fee42-c32d-f111-97eb-b7257c52c8db", "documentTypeCode": "NEW", "description": "New Type", "templates": 1, "documents": 1 } |
POST documentType
Description
Creates a new document type in Business Central.
HTTP Request
POST
https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentType
Request Headers
| Header | Value |
| Authorization | NTLM, OAuth2. Required. |
| Accept | application/json |
Request Body
Provide a JSON object with document type data.
JSON
|
{ "documentTypeCode": "CONTRACT", "description": "Rental Agreement" } |
Response
Returns a 201 Created status code and the created document type object.
PATCH documentType
Description
Updates the existing documentType in Business Central.
HTTP Request
PATCH
https://{{businesscentralPrefix}}/api/soft4/soft4spaces/v3.0/companies({{companyId}})/documentType({{documentType_id}})
Request Headers
| Header | Value |
| Authorization | NTLM, OAuth2. Required. |
| Accept | application/json |
Request Body
Provide the fields to be updated of document type in Business Central.
JSON
|
{ "description": "Rental Agreement 2026" } |
Response
Returns a 200 OK status code.
Properties
| Property | Type | Description |
| id | GUID | The unique ID of the document type. Non-editable. |
| documentTypeCode | string | Specifies the document type code. Must be a unique value. |
| description | string | Specifies the document type description. |
| templates | integer | Specifies the number of related document templates, |
| documents | integer | Specifies the number of documents with this type. |
JSON Representation
|
{ "id": GUID, "documentTypeCode": string, "description": string, "templates": integer, "documents": integer } |
Related API's (expand)
| Name | Type | Description |
| documents | Collection(Microsoft.NAV.leaseContractLines) | Gets the leasecontractlines of the leaseContract. |
| documentTemplates | Microsoft.NAV.customer | Gets the customer of the leaseContract. |