Create

To create a new folder you need to execute a POST request against the /libraries/:id/folders endpoint.

Two fields are available in the JSON body of the POST request:

  • name - the name of the folder. Required.

  • parent_id - the id of the parent folder. Omit this field if the folder is attached to the root of the library and not to a parent folder.

In the response you will find the unique id which identifies the folder.

1. Request (folder created in the root of the library)

curl --request POST \
  --header "Content-Type: application/json" \
  --url https://api.digitalsamba.com/api/v1/libraries/8606721f-d847-4721-a5dc-6537e822104c/folders \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
  --data '{"name": "Birthday Party"}'

Response (200 OK)

{
    "id": "1fc95d41-5358-4a81-adb4-5cd8c12e8308",
    "name": "Birthday Party",
    "parent_id": null,
    "source": "api",
    "created_at": "2024-10-08T08:05:51Z"
}

2. Request (creates a nested folder in the existing "Birthday Party" folder)

curl --request POST \
  --header "Content-Type: application/json" \
  --url https://api.digitalsamba.com/api/v1/rooms \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
  --data '{"name": "Holiday in Greece", "parent_id": "1fc95d41-5358-4a81-adb4-5cd8c12e8308"}'

Response (200 OK)

{
    "id": "428c31a2-ae2d-468c-a1f7-46b832c7b13a",
    "name": "2024",
    "parent_id": "1fc95d41-5358-4a81-adb4-5cd8c12e8308",
    "source": "api",
    "created_at": "2024-10-08T10:04:36Z"
}

Last updated