Client files

Use these methods to manage files uploaded to client folders in the Back Office.

GET[host]/api/v2/clients/{clientId}/files

Get a list of client files

POST[host]/api/v2/clients/{clientId}/files

Upload a client file

PUT[host]/api/v2/clients/{clientId}/files/{fileId}

PATCH[host]/api/v2/clients/{clientId}/files/{fileId}

Update a client file

DELETE[host]/api/v2/clients/{clientId}/files/{fileId}

Delete a client file

Use these methods to manage client folders in the Back Office.

POST[host]/api/v2/clients/{clientId}/folders

Create a new client folder

PUT[host]/api/v2/clients/{clientId}/folders/{folderId}

PATCH[host]/api/v2/clients/{clientId}/folder/{folderId}

Update a client folder

DELETE[host]/api/v2/clients/{clientId}/folder/{folderId}

Delete a client folder

Get a list of client files

Use this method to obtain a list of files uploaded for a specific client.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

Query parameters:

The following filter parameter is available for this method:

directoryId

The identifier of a folder where the file is stored.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/clients/{clientId}/files

curl --location -g --request GET 'https://host.name/api/v2/clients/1/files?filter[directoryId]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response provides the following data about the files matching the request parameters:

id integer

The identifier of a file.

name string

The name of a file.

file string

The path to the file in the Back Office.

directoryId integer or null

The identifier of a folder where the file is stored.

priority integer

The priority index assigned to a file.

RESPONSE EXAMPLE
{
  "id": 1,
  "name": "Service agreement",
  "file": "y/1662913861_file.pdf",
  "directoryId": 1,
  "priority": 1
}

Upload a client file

Use this method to upload a file for a specific client.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

Body:

Specify the following parameters for a file:

file string required

The path to the file that you want to upload.

caption string required

The name of a file in the Back Office.

directoryId integer

The identifier of a folder to which you want to upload the file.

POST[host]/api/v2/clients/{clientId}/files

curl --location --request POST 'https://host.name/api/v2/clients/1/files' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data raw '{
  "file": "file.pdf",
  "caption": "Service agreement"
  "directoryId": 1
}'

Response

A response provides the following data about the file that was uploaded:

id integer

The identifier of a file.

name string

The name of a file.

clientId integer

An identifier of a client.

directoryId integer or null

The identifier of a folder where the file is stored.

file string

The path to the uploaded file.

RESPONSE EXAMPLE
{
  "id": 1,
  "name": "Service agreement",
  "clientId": 1,
  "directoryId": 1,
  "file": "y/1662913861_file.pdf"
}

Update a client file

Use this method to update a specified client file.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

fileId required

The identifier of a file.

Body:

The following field values can be updated for a file:

caption string

The name of a file in the Back Office.

directoryId integer

The identifier of a folder where the file is stored.

PUT[host]/api/v2/clients/{clientId}/files/{fileId}

curl --location --request PUT 'https://host.name/api/v2/clients/1/files/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data raw '{
  "caption": "File",
  "directoryId": 1
}'

Response

A response provides the following data about the file that was updated:

id integer

The identifier of a file.

name string

The name of a file.

clientId integer

The identifier of a client.

directoryId integer or null

The identifier of a folder where the file is stored.

file string

The path to the updated file.

RESPONSE EXAMPLE
{
  "id": 1,
  "name": "Service agreement",
  "clientId": 1,
  "directoryId": 1,
  "file": "y/1662913861_file.pdf"
}

Delete a client file

Use this method to remove a specified client file.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

fileId required

The identifier of a file.

DELETE[host]/api/v2/clients/{clientId}/files/{fileId}

curl --location --request DELETE 'https://host.name/api/v2/clients/1/files/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.


Create a new client folder

Use this method to create a new folder for a specific client.

The new folder is added only to the folder tree of the specified client. This doesn’t affect the default folder tree that has been configured for all clients in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

Body:

Specify the following parameters for a folder:

caption string

The name of a folder.

directoryId integer

The identifier of a parent folder in which you want to include a new folder.

POST[host]/api/v2/clients/{clientId}/folders

curl --location --request POST 'https://host.name/api/v2/clients/1/folders' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data raw '{
  "caption": "General info",
  "directoryId": 1
}'

Response

A response provides the following data about the folder that was created:

id integer

The identifier of a folder.

name string

The name of a folder.

directoryId integer or null

The identifier of a parent folder in which the newly created folder is included.

treeFolderId integer or null

The identifier of a client’s folder tree.

RESPONSE EXAMPLE
{
  "id": 1,
  "name": "General info",
  "clientId": 1,
  "directoryId": 1,
  "treeFolderId": null
}

Update a client folder

Use this method to rename a folder for a specific client.

The folder is renamed only for the specified client. This doesn’t affect the default folder tree that has been configured for all clients in the Back Office.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

folderId required

The identifier of a folder.

Body:

The following field value can be updated for a folder:

caption string required

The name of a folder.

PUT[host]/api/v2/clients/{clientId}/folder/{folderId}

curl --location --request PUT 'https://host.name/api/v2/clients/1/folders/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data '{
  "caption": "Personal info"
}'

Response

A response provides the following data about the folder that was updated:

id integer

The identifier of a folder.

name string

The name of a folder.

directoryId integer or null

The identifier of a parent folder in which the updated folder is included.

treeFolderId integer or null

The identifier of a client’s folder tree.

RESPONSE EXAMPLE
{
  "id": 1,
  "name": "Personal info",
  "clientId": 1,
  "directoryId": 1,
  "treeFolderId": null
}

Delete a client folder

Use this method to remove a folder for a specific client.

The folder is removed only from the folder tree of the specified client. This doesn’t affect the default folder tree that has been configured for all clients in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The identifier of a client.

folderId required

The identifier of a folder.

DELETE[host]/api/v2/clients/{clientId}/files/{fileId}

curl --location --request DELETE 'https://host.name/api/v2/clients/1/folders/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.