Import files from cloud storage
POST/v5/files/cloud_imports
Register files that already exist in cloud blob storage as file records, in one batch.
Unlike upload, this transfers no bytes: each entry references an existing object by its container/bucket, filepath, filename, and MIME type, and only a metadata record pointing at that object is created. Files are imported independently and the response reports a per-file status. The response is 200 when every import succeeds and 207 when results are mixed, with each result marked SUCCESS or a failure reason (file does not exist, invalid permissions, or unknown error). Failed entries carry only the submitted filename and MIME type rather than a full file record.
Import files from cloud storage
curl https://api.egp.scale.com/v5/files/cloud_imports \
-H 'Content-Type: application/json' \
-H "x-api-key: $SGP_API_KEY" \
-d '{
"files": [
{
"container": "container",
"file_type": "file_type",
"filename": "filename",
"filepath": "filepath"
}
]
}'{
"results": [
{
"file": {
"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"
}
},
"status": "SUCCESS"
}
]
}Returns Examples
{
"results": [
{
"file": {
"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"
}
},
"status": "SUCCESS"
}
]
}