Get file metadata
files.retrieve(strfile_id, FileRetrieveParams**kwargs) -> SGPFile
GET/v5/files/{file_id}
Retrieve a single file’s metadata by id.
Returns the file record (id, filename, MIME type, size, tags, and related fields) but not the file’s bytes; use the content endpoint to download the bytes.
Get file metadata
import os
from scale_gp_beta import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
sgp_file = client.files.retrieve(
file_id="file_id",
)
print(sgp_file.id){
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"filename": "filename",
"md5_checksum": "md5_checksum",
"mime_type": "mime_type",
"size": 0,
"duration_seconds": 0,
"object": "file",
"tags": {
"foo": "bar"
}
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"filename": "filename",
"md5_checksum": "md5_checksum",
"mime_type": "mime_type",
"size": 0,
"duration_seconds": 0,
"object": "file",
"tags": {
"foo": "bar"
}
}