Storage API
GET /storage
Reads a file from storage.
Request
GET /storage
Parameters
Name | Location | Description | Schema |
---|---|---|---|
id | url | The key of the file. | long |
version | url | The version of the file. Optional. | long |
action | url | ‘download’ to force download. ‘view’ otherwise. | string |
Response
The binary file.
cURL example
Request
curl --header "X-API-Key: <your_access_token>" \
--url "https://example.kodall.app/storage?id=1"
--output output.txt
Response
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13749 100 13749 0 0 94975 0 --:--:-- --:--:-- --:--:-- 95479
POST /storage
Add a file to storage.
Request
POST /storage
Response
The json with information about the file.
cURL example
Request
curl --location "http://example.kodall.app/storage" \
--header "x-api-key: <your_access_token>" \
--form "filename=@/path/to/file"
If you want to overwrite an existing storage use /{key}
curl --location "http://example.kodall.app/storage/1" \
--header "x-api-key: <your_access_token>" \
--form "filename=@/path/to/file"
Response
[{"name":"blank.pdf","id":6}]
GET /storage/file-version
Reads a file from storage.
Request
GET /storage/file-version
Parameters
Name | Location | Description | Schema |
---|---|---|---|
id | url | The key of the file. | long |
version | url | The version of the file. Optional. | long |
action | url | ‘download’ to force download. ‘view’ otherwise. | string |
Response
The binary file.
cURL example
Request
curl --header "X-API-Key: <your_access_token>" \
--url "https://example.kodall.app/storage/file-version?id=1"
--output output.txt
Response
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13749 100 13749 0 0 94975 0 --:--:-- --:--:-- --:--:-- 95479
POST /storage/file-version
Add a file to storage.
Request
POST /storage/file-version
Response
The json with information about the file.
cURL example
Request
curl --location "http://example.kodall.app/storage/file-version" \
--header "x-api-key: <your_access_token>" \
--form "filename=@/path/to/file"
If you want to overwrite an existing storage use /{key}
curl --location "http://example.kodall.app/storage/file-version/1" \
--header "x-api-key: <your_access_token>" \
--form "filename=@/path/to/file"
The response will return a new storage-file-version ID but no storage-file will be created.
Response
[{"name":"blank.pdf","id":6}]