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.
Kelvin API Kelvin API Client (Python)
API cURL Example 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;
API cURL Example Response {
"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"
}
}
API Client (Python) Example 1
2
3
4
5
6
7
8
9
10
11
12 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;
API Client (Python) Example Response f ile_id=' f ddbcc 17-1393-4721-86 ad -21 ae 1e c 2 f 326 ' f ile_ na me='da ta .csv' f ile_size= 1375 checksum=' 462 a 4133 b 03109e c 4 b 20e aa 002 bea 303 dc 7 ae f 33045e963 c 3 dc 1860 a f 8e b 00 bb' source='kr n : user : ivo. fernan des@kelvi n i n c.com' crea te d=da tet ime.da tet ime( 2024 , 3 , 22 , 10 , 13 , 22 , 592889 , t zi nf o=da tet ime. t imezo ne .u t c) me ta da ta = { 'allowPlayback' : True }