Get an upload by ID
client.uploads.retrieve(stringid, RequestOptionsoptions?): Upload { info, metadata, spec }
GET/v1/uploads/{id}
Retrieves the current state of an upload, including its lifecycle status
Get an upload by ID
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const upload = await client.uploads.retrieve('id');
console.log(upload.info);{
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_USER",
"email": "email",
"name": "name"
}
},
"status": "UPLOAD_STATUS_UNSPECIFIED",
"uploadUrl": "uploadUrl",
"uploadUrlExpiresAt": "2019-12-27T18:11:19.117Z"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"contentType": "contentType",
"filename": "filename",
"sizeBytes": "sizeBytes"
}
}Returns Examples
{
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_USER",
"email": "email",
"name": "name"
}
},
"status": "UPLOAD_STATUS_UNSPECIFIED",
"uploadUrl": "uploadUrl",
"uploadUrlExpiresAt": "2019-12-27T18:11:19.117Z"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"contentType": "contentType",
"filename": "filename",
"sizeBytes": "sizeBytes"
}
}