finsit API - CompanyDocument

A collection of help pages for using the API.

CompanyDocument

URL /Api/v2/Company/{companyId}/Document/{documentId}
Accepted verbs GET, POST, PUT, DELETE
Description

Provides methods to get and administrate documents and folders for a company.

GET /Api/v2/Company/{companyId}/Document

Get the whole document structure for a company.

Parameters
NameDescriptionAdditional information
companyId Company id.

URI parameter

Returns

The whole document structure in the root folder for the company. See DocumentFolder.

GET /Api/v2/Company/{companyId}/Document/{documentId}

Get a specific DocumentFile or DocumentFolder by its id.

Parameters
NameDescriptionAdditional information
companyId Company id.

URI parameter

documentId Id of the document to fetch.

URI parameter

Returns

The requested DocumentFile or DocumentFolder.

POST /Api/v2/Company/{companyId}/Document

Create a new document or folder. The submitted DocumentFile or DocumentFolder should not specify its id; it will be automatically assigned when it is being created. It is possible to create a path of folders by specifying a segmented path name that does not already exist. For example, in an empty root folder it is possible to create the path '/path/to/some/folder' by creating a folder with that name. It will automatically create the four folders 'path', 'to', 'some' and 'folder' in the specified hierarchy. Although, it is not possible to create tree structures of folders by manually providing child ids in the folder object's child property. It is also possible to bulk create many file and/or folders by posting an array of DocumentFolder and/or DocumentFile.

Parameters
NameDescriptionAdditional information
companyId Company id.

URI parameter

document The new DocumentFile or DocumentFolder to create.

Body data

Returns

The newly created DocumentFile or DocumentFolder. The object will now have an id assigned to it. If the request pretains to bulk create documents, the return value will be an array with the newlty, successfully created DocumentFile or DocumentFolder

PUT /Api/v2/Company/{companyId}/Document

Update an existing DocumentFile or DocumentFolder. Files can be moved around in the folder structure by redefining its parent. Changing the children will not affect the folder structure.

Parameters
NameDescriptionAdditional information
companyId Company id.

URI parameter

document Updated DocumentFile or DocumentFolder.

Body data

Returns

The DocumentFile or DocumentFolder with updated.

DELETE /Api/v2/Company/{companyId}/Document/{documentId}

Delete a document or folder. Deleting a folder with underlying content will result in removal of that whole structure.

Parameters
NameDescriptionAdditional information
companyId Company id.

URI parameter

documentId Id of the document to delete.

URI parameter