Get File Info
In this example we will retrieve the information about a file in storage on the Kelvin Platform.
You can only delete one file at a time. You need to use the id of the file which will be a UUID number. You can not use the filename.
curl -X "GET" \
"https://<url.kelvin.ai>/api/v4/filestorage/ef636192-e7eb-4f15-82df-2880df880f65/get" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json"
The response will look like this;
{
"file_id": "ef636192-e7eb-4f15-82df-2880df880f65",
"file_name": "test_data.csv",
"file_size": 40,
"checksum": "c9e7404f3c7f77dbb85e273deb48a4e95ed1fd373672fc3c2a6ef44bef2349b7",
"created": "2024-03-19T10:29:55.673471Z",
"source": "krn:user:demo@kelvin.ai",
"metadata": {
"customkey": "Custom metadata information"
}
}
from kelvin.api.client import Client
# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")
# Get Info on File in Filestorage
response = client.filestorage.get_file(
file_id='0107549c-2069-4824-bc4f-30c7bc94172e'
)
print(response)
You will see the output like this;
file_id='fddbcc17-1393-4721-86ad-21ae1ec2f326' file_name='data.csv' file_size=1375 checksum='462a4133b03109ec4b20eaa002bea303dc7aef33045e963c3dc1860af8eb00bb' source='krn:user:ivo.fernandes@kelvininc.com' created=datetime.datetime(2024, 3, 22, 10, 13, 22, 592889, tzinfo=datetime.timezone.utc) metadata={'allowPlayback': True}