File storage
Use these methods to get information about the file storage used to organize and store files uploaded to B2Core, such as client documents submitted for verification, client photos and others.
The file storage can use a local or an external data storage system.
GET[host]/api/v2/storages |
|
GET[host]api/v2/storages/{storageI} |
|
GET[host]api/v2/storages/{storageId}/status |
|
PUT[host]/api/v2/storages/{storageId} PATCH[host]/api/v2/storages/{storageId} |
Get a list of data storage systems
Use this method to obtain a list of the data storage systems used to store the files uploaded to B2Core.
To obtain detailed information about a specific data storage system, use a separate method to get data storage system details.
Request
Header parameters:
Authorization: Bearer <token>
GET[host]/api/v2/storages
curl --location 'https://host.name/api/v2/storages?limit=10&offset=0' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of File Storage objects providing information about the available data storage systems.
Get data storage system details
Use this method to obtain detailed information about a specified data storage system.
To obtain a full list of data storage systems, use a separate method to get a list data storage systems.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- storageId required
The storage identifier.
GET[host]api/v2/storages/{storageI}
curl --location 'https://host.name/api/v2/storages/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes a File Storage object providing information about the specified data storage system.
Validate the connection to a data storage system
Use this method to validate the connection settings of a specified data storage system.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- storageId required
The storage identifier.
GET[host]api/v2/storages/{storageId}/status
curl --location 'https://host.name/api/v2/storages/1/status' \
--header 'Authorization: Bearer <token>'
Response
If the connection settings of the specified data storage system are valid, no response body is returned.
Update data storage system details
Use this method to update the information about a specified data storage system or modify its connection settings.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- storageId required
The storage identifier.
Body:
The following field values can be updated:
- provider string
The name of the data storage system used to store the uploaded files.
- cacheTime integer
The period during which the cached data is valid.
- options object
The connection settings specific to a data storage system.
PUT[host]/api/v2/storages/{storageId}
curl --location --request PATCH 'https://host.name/api/v2/storages/1' \
--header 'Authorization: Bearer <token>' \
--data '{
"provider": "local",
"cacheTime": 0,
"options": {}
}'
Response
A response includes a File Storage object providing information about the updated storage.