Skip to content

Get file metadata

GET /organizations/{org_id}/assets/{asset_id}

This gets the details of one uploaded file. Tallyfy’s API calls a file an “asset”. You get details like the filename, the upload date, and what the file is attached to.

Replace {org_id} with your organization ID. Replace {asset_id} with the file’s asset ID.

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const assetId = 'ASSET_ID_TO_GET_METADATA';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/assets/${assetId}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'GET',
headers: headers
})
.then(response => {
if (!response.ok) {
return response.json()
.catch(() => response.text())
.then(errData => {
console.error(`Error response for asset ${assetId}:`, errData);
throw new Error(`HTTP error! status: ${response.status}`);
});
}
return response.json();
})
.then(data => {
console.log(`Metadata for asset ${assetId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting asset metadata ${assetId}:`, error.message);
});

You’ll get 200 OK. The file’s details are in the data property of the JSON.

{
"data": {
"id": "ASSET_ID_TO_GET_METADATA",
"filename": "report_q1.pdf",
"version": 1,
"uploaded_from": "capture_id_abc123",
"uploaded_at": "2024-03-15T10:30:00Z",
"step_id": "step_id_xyz789",
"source": "local",
"system": null,
"uploaded_to_s3": true,
"subject": {
"id": "run_id_or_checklist_id",
"type": "Run"
}
}
}

Key fields in the response:

FieldDescription
idUnique asset identifier
filenameOriginal filename of the uploaded file
versionVersion number of the asset
uploaded_fromForm field ID the file was uploaded from, or ko_field for kick-off fields
uploaded_atTimestamp when the file was uploaded
step_idStep ID if the file is attached to a task step (can be null)
sourceUpload source - defaults to local
systemExternal storage system if applicable (e.g., Dropbox, Google Drive)
uploaded_to_s3Whether the file was stored in S3
subjectObject containing the parent’s id and type (e.g., Run, Checklist, Organization)

You’ll get an error if the asset ID isn’t found or you don’t have permission. The status code is 404 or 403.


Files > Download file

Tallyfy’s API provides two GET endpoints for retrieving uploaded files: one that returns the…

Files > Delete file

Tallyfy’s API lets you permanently delete an uploaded file and its storage record by sending a…