Disk
Files
POST /api/disk/list
Parameters
path = /my/folder
Get a list of files and folders at the specified path
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/list', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder',
]
]);
// Response
[
'error' => '0',
'data' => [
'0' => [
'type' => 'folder',
'name' => 'test',
'path' => '/my/folder/test',
]
'1' => [
'type' => 'image',
'name' => 'image.jpg',
'path' => '/my/folder/image.jpg',
]
]
]
POST /api/disk/file/upload/link
Parameters
path = /my/folder/image.jpg
link = https://example.com/image-name.jpg
Upload a file from an available web link. Folders are created automatically
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/upload/link', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
'link' => 'https://example.com/image-name.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'image.jpg',
'path' => '/my/folder/image.jpg',
'size' => '1024',
'type' => 'image',
'cdn_link' => '',
'created_at' => '2021-08-01 12:00:00',
'updated_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/file/info
Parameters
path = /my/folder/image.jpg
Getting information about a file
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/info', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'image.jpg',
'path' => '/my/folder/image.jpg',
'size' => '1024',
'type' => 'image',
'cdn_link' => '',
'created_at' => '2021-08-01 12:00:00',
'updated_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/file/move
Parameters
from = /my/folder/image.jpg
to = /my/folder2/image.jpg
Move file to another folder or rename. Folders are created automatically
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/move', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'from' => '/my/folder/image.jpg',
'to' => '/my/folder2/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'image.jpg',
'path' => '/my/folder2/image.jpg',
'size' => '1024',
'type' => 'image',
'cdn_link' => '',
'created_at' => '2021-08-01 12:00:00',
'updated_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/file/rename
Parameters
from = /my/folder/image.jpg
to = /my/folder/image-new-name.jpg
Move file to another folder or rename
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/rename', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'from' => '/my/folder/image.jpg',
'to' => '/my/folder/image-new-name.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'image-new-name.jpg',
'path' => '/my/folder/image-new-name.jpg',
'size' => '1024',
'type' => 'image',
'cdn_link' => '',
'created_at' => '2021-08-01 12:00:00',
'updated_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/file/delete
Parameters
path = /my/folder/image.jpg
Delete file
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/delete', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => []
]
POST /api/disk/file/download-link
Parameters
path = /my/folder/image.jpg
Getting a temporary link to download a file
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/download-link', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'link' => 'https://ezerbox.com/d/df8WhJhdflfdgWyga.jpg',
]
]
POST /api/disk/file/cdn/create
Parameters
path = /my/folder/image.jpg
Create permanent cdn link to file
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/cdn/create', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => [
'link' => 'https://cdn.ezerbox.com/p/j58dkg.jpg',
]
]
POST /api/disk/file/cdn/delete
Parameters
path = /my/folder/image.jpg
Deleting cdn link
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/file/cdn/delete', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder/image.jpg',
]
]);
// Response
[
'error' => '0',
'data' => []
]
Folders
POST /api/disk/folder/create
Parameters
path = /my/folder
Create a folder at the specified path
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/folder/create', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'folder',
'path' => '/my/folder',
'created_at' => '2021-08-01 12:00:00',
'update_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/folder/info
Parameters
path = /my/folder
Get information about a folder
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/folder/info', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder',
]
]);
// Response
[
'error' => '0',
'data' => [
'name' => 'folder',
'path' => '/my/folder',
'created_at' => '2021-08-01 12:00:00',
'update_at' => '2021-08-01 12:00:00',
]
]
POST /api/disk/folder/delete
Parameters
path = /my/folder
Delete folder
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.ezerbox.com/api/disk/folder/delete', [
'headers' => [
'token' => 'test'
],
'form_params' => [
'path' => '/my/folder',
]
]);
// Response
[
'error' => '0',
'data' => []
]