Create and delete folders

Circularo REST API example

Create root and nested folder, then delete them.

Step 1 - Sign in

Sign user in.

Endpoint

POST - /login

Example

/login

Content-Type: application/json

{
  "name": "mary.griffin@circularo.com",
  "password": "#32Password1!",
  "tenant": "default"
}

Response

Note following properties in response object:

  • token - In response object at position ‘token‘. It may have value of “ryH1DXOXIH8GJKRDRMFHByGCcl2NpLa4KaSOxpgoDpMLqlXhoUz55vPyE6tlDset“.

Step 2 - Create root folder

Create new shared folder in root. Use ‘“isShared”: false’ to create private folder.

Endpoint

POST - /folders

Example

/folders?token=ryH1DXOXIH8GJKRDRMFHByGCcl2NpLa4KaSOxpgoDpMLqlXhoUz55vPyE6tlDset

Content-Type: application/json

{
  "name": "My root folder",
  "isShared": true,
  "parentFolderId": null
}

Response

Note following properties in response object:

  • rootFolderId - In response object at position ‘id‘. It may have value of “fbd5f40b-da41-4a7e-9a20-de897b70bbae“.

The folder is now created. All nested folders must be shared as well.

Step 3 - Create nested folder

Create a nested folder. As the parent folder is shared, this one must be too.

Endpoint

POST - /folders

Example

/folders?token=ryH1DXOXIH8GJKRDRMFHByGCcl2NpLa4KaSOxpgoDpMLqlXhoUz55vPyE6tlDset

Content-Type: application/json

{
  "name": "Nested folder",
  "isShared": true,
  "parentFolderId": "fbd5f40b-da41-4a7e-9a20-de897b70bbae"
}

Response

Note following properties in response object:

  • nestedFolderId - In response object at position ‘id‘. It may have value of “7ef941cc-e2d4-4d5d-9e7d-5b75689eb82a“.

The nested folder is now created.

Step 4 - Delete root folder

Deletes root folder. All nested folders are also removed.

If you send ‘“hardDelete”: false’, the folder is moved to trash instead.

In case of ‘“hardDelete”: true’ you can specify ‘deleteContent’ property.

In case of ‘“deleteContent”: true’ all documents in this folder and all nested folders will be deleted as well.

In case of ‘“deleteContent”: false’ those documents will be removed from its folders but not deleted.

Endpoint

DELETE - /folders

Example

/folders?token=ryH1DXOXIH8GJKRDRMFHByGCcl2NpLa4KaSOxpgoDpMLqlXhoUz55vPyE6tlDset&hardDelete=true&deleteContent=true

Content-Type: application/json

{
  "folderIds": [
    "fbd5f40b-da41-4a7e-9a20-de897b70bbae"
  ]
}

The folder, all nested folders and all documents are now deleted.

Step 5 - Sign out (Optional)

Sign user out.

Endpoint

GET - /logout

Example

/logout?token=ryH1DXOXIH8GJKRDRMFHByGCcl2NpLa4KaSOxpgoDpMLqlXhoUz55vPyE6tlDset