Skip to content

Get file metadata

Endpoint

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

This endpoint retrieves metadata (like filename, upload date, related object) for a specific uploaded file (referred to as an โ€œAssetโ€ in Tallyfyโ€™s API).

Request

Replace {org_id} with your Organization ID and {asset_id} with the Asset ID of the file whose metadata you want.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Query parameters (optional)

No common query parameters are typically needed for this endpoint.

Code samples

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) {
// Attempt to parse error as JSON, fallback to text
return response.json()
.catch(() => response.text()) // If JSON parsing fails, get 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(`Successfully retrieved metadata for asset ${assetId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting asset metadata ${assetId}:`, error.message);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data array (usually with one element) holding the asset metadata.

{
"data": [
{
"id": "ASSET_ID_TO_GET_METADATA",
"filename": "report_q1.pdf",
"version": 1,
"step_id": "step_id_xyz789", // If related to a task step
"uploaded_from": "capture_id_abc123", // Form field ID or 'ko_field'
"uploaded_to_s3": true,
"subject": {
"id": "run_id_or_checklist_id",
"type": "Run" // Or "Checklist"
},
"uploaded_at": "YYYY-MM-DDTHH:MM:SSZ"
// Other potential metadata fields like size, uploader ID, etc.
}
]
}

If the asset ID is not found or you lack permission, Tallyfy will return a 404 or 403 error.


Files > Download file

The Tallyfy API provides endpoints to download or view files inline using GET requests with organization and file IDs where the response returns raw file content with appropriate Content-Type headers rather than JSON data.

Files > Delete file

A DELETE endpoint that removes uploaded files from tasks or kick-off forms by making authorized requests to either /organizations/[org_id]/file/[asset_id] or /organizations/[org]/assets/[assetID] endpoints and returns a 200 OK status code upon successful deletion.

Code Samples > Managing files

The API enables file management functionalities including uploading downloading getting metadata and removing files associated with tasks or kick-off forms.

Groups > Get group

The GET endpoint allows retrieving detailed information about a specific group within an organization using its unique ID through authenticated API requests with code examples in multiple programming languages.