Using the API, you can get, create & delete folders.
Get a folder by ID
$ curl -X GET "https://ufile.io/v1/folders/FOLDER_ID" \
-H "X-API-KEY: YOUR_API_KEY"
Response Example
{
"id": "47866",
"user_id": "1",
"name": "my folder",
"slug": "vf5c4",
"public": "1",
"folder_id": null, // parent folder
"is_deleted": "0",
"session_id": "abc",
"allow_uploads": "0"
}
List Folders
$ curl -X GET "https://ufile.io/v1/folders/" \
-H "X-API-KEY: YOUR_API_KEY"
Optional GET params: "folder_id" - E.G - https://ufile.io/v1/folders/?folder_id=123 to return all sub folders from folder 123
Response Example
[
{
"id": "46303",
"user_id": "1",
"name": "My public folder",
"slug": "b8pci",
"public": "1",
"folder_id": null,
"is_deleted": "0",
"session_id": null,
"allow_uploads": "1"
},
{...}
]
Create Folder
$ curl -X POST "https://ufile.io/v1/folders/" \
-H "X-API-KEY: YOUR_API_KEY"
Optional POST params: "folder_id", "name", "public"
Response Example
[
{
"id": "46303",
"user_id": "1",
"name": "My public folder",
"slug": "b8pci",
"public": "1",
"folder_id": null,
"is_deleted": "0",
"session_id": null,
"allow_uploads": "1"
},
{...}
]
Delete Folder
$ curl -X DELETE "https://ufile.io/v1/folders/FOLDER_ID" \
-H "X-API-KEY: YOUR_API_KEY"