Introduction
FileManagerFiles
represent a on the filesystem. FileManagerFiles
will always attach an url
to a .
There is no direct relation to a . The resolution of files and directories is done by their path
property.
A file can be saved on any path. If there are no added which represent the sections of the path, the according will be created.
Model Definition
Alias
filemanagerFile
Relations
Relation
Key
Type
Relation Field(s)
Computed Properties
hash
- The hashed id
of the FilemanagerFile
name
- The basename of the FilemanagerFile
url
- Encoded URL to the underlying file
Traits
List
Definition
GET
/api/filemanager/files
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/filemanager/files', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
Copy [
{
"id": 1,
"user_id": 3,
"path": "/Lorem ipsum/Lorem Ipsum.pdf",
"extension": "pdf",
"mime_type": "application/pdf",
"size": 87236,
"created_at": "2018-12-20 13:58:15",
"updated_at": "2018-12-21 15:55:10",
"deleted_at": null,
"hash": "zn7m24owk63qolxryge8pj05",
"name": "Lorem Ipsum.pdf",
"url": "/files/jjee2zq97k8ztpzy67xpreeysxzx00onx940bn884yqqdeow/Lorem Ipsum.pdf"
},
{
"id": 2,
"user_id": 3,
"path": "/Lorem ipsum/Dolor sit amet.jpg",
"extension": "jpg",
"mime_type": "image/jpeg",
"size": 187607,
"created_at": "2018-12-20 13:58:19",
"updated_at": "2018-12-21 15:55:18",
"deleted_at": null,
"hash": "6o8m0kz5yw10x1pr9e4vxj27",
"name": "Dolor sit amet.jpg",
"url": "/files/jjee2zq97k8ztpzy67xpreeysxzx00onx940bn884yqqdeow/Dolor sit amet.jpg"
}
]
List by path
If you don't pass a value for {path}
a call to the root folder will be assumed.
Definition
GET
/api/filemanager/files/path/{path}
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/filemanager/files/path/Lorem%20ipsum', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
Copy [
{
"id": 1,
"user_id": 3,
"path": "/Lorem ipsum/Lorem Ipsum.pdf",
"extension": "pdf",
"mime_type": "application/pdf",
"size": 87236,
"created_at": "2018-12-20 13:58:15",
"updated_at": "2018-12-21 15:55:10",
"deleted_at": null,
"hash": "zn7m24owk63qolxryge8pj05",
"name": "Lorem Ipsum.pdf",
"url": "/files/jjee2zq97k8ztpzy67xpreeysxzx00onx940bn884yqqdeow/Lorem Ipsum.pdf"
},
{
"id": 2,
"user_id": 3,
"path": "/Lorem ipsum/Dolor sit amet.jpg",
"extension": "jpg",
"mime_type": "image/jpeg",
"size": 187607,
"created_at": "2018-12-20 13:58:19",
"updated_at": "2018-12-21 15:55:18",
"deleted_at": null,
"hash": "6o8m0kz5yw10x1pr9e4vxj27",
"name": "Dolor sit amet.jpg",
"url": "/files/jjee2zq97k8ztpzy67xpreeysxzx00onx940bn884yqqdeow/Dolor sit amet.jpg"
}
]
Count
Definition
GET
/api/filemanager/files/count
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/filemanager/files/count', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
Show
Show a single FilemanagerFile
by id
.
Definition
GET
/api/filemanager/files/{id}
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/filemanager/files/1', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
Copy {
"id": 1,
"user_id": 3,
"path": "/Lorem ipsum/Lorem Ipsum.pdf",
"extension": "pdf",
"mime_type": "application/pdf",
"size": 87236,
"created_at": "2018-12-20 13:58:15",
"updated_at": "2018-12-21 15:55:10",
"deleted_at": null,
"hash": "zn7m24owk63qolxryge8pj05",
"name": "Lorem Ipsum.pdf",
"url": "/files/jjee2zq97k8ztpzy67xpreeysxzx00onx940bn884yqqdeow/Lorem Ipsum.pdf"
}
Create
Create a new FilemanagerFile
.
Definition
POST
/api/filemanager/files
Request Keys
Key
Type
Default
Description
Relative path to the FilemanagerFile
(normalized to include leading /
)
Keys with *
are required.
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/filemanager/files', [
'headers' => ['Authorization' => "Bearer {$accessToken}"],
'multipart' => [
[
'name' => 'file',
'contents' => fopen('/path/to/file/Lorem ipsum.pdf', 'r')
],
[
'name' => 'path',
'contents' => 'Lorem ipsum.pdf'
]
]
]);
Example Response
Copy {
"status": "success",
"data": {
"id": 3,
"user_id": 3,
"path": "/Lorem ipsum.pdf",
"extension": "pdf",
"mime_type": "application/pdf",
"size": 13997,
"created_at": "2020-02-12 10:58:12",
"updated_at": "2020-02-12 10:58:12",
"hash": "zn7m24owk63qolxryge8pj05",
"name": "Lorem ipsum.pdf",
"url": "/api/files/4geewv9rjq6vt8ovz6r8jppv/Lorem ipsum.pdf"
}
}
Update
Update an existing FilemanagerFile
by id
.
Definition
PUT
/api/filemanager/files/{id}
Request Keys
Relative path to the FilemanagerFile
(normalized to include leading /
)
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/filemanager/files/3', [
'headers' => ['Authorization' => "Bearer {accessToken}"],
'json' => [
'path' => 'Dolor sit amet/Lorem ipsum.pdf'
]
]);
Example Response
Copy {
"status": "success",
"data": {
"id": 3,
"user_id": 3,
"path": "/Dolor sit amet/Lorem ipsum.pdf",
"extension": "pdf",
"mime_type": "application/pdf",
"size": 13997,
"created_at": "2020-02-12 10:58:12",
"updated_at": "2020-02-12 11:10:17",
"hash": "zn7m24owk63qolxryge8pj05",
"name": "Lorem ipsum.pdf",
"url": "/api/files/2yqqxnoe82dnivng6jevz44gcj8j8ry8kkv4i57yrxeonrjjt0dve4g/Lorem ipsum.pdf"
}
}
Delete
Delete an existing FilemanagerFile
by id
.
Definition
DELETE
/api/filemanager/files/{id}
Example Request
PHP
Copy $client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/filemanager/files/3', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
Copy {
"status": "success",
"data": null
}