Files
Get minimal file details
/a/File_getFileDetailsByEnumAndId
Return minimal download metadata for a file ID when it also has the expected positive file type.
When to use this endpoint
Use File_getFileDetailsByEnumAndId for legacy Asset-file widgets that validate a stored file reference before showing it. Despite the name, id is the file ID, not the resource ID.
Authentication and permissions
Normal requests require signed API-key authentication or a logged-in CRM session and are scoped to that tenant. In CRM2, ordinary file types additionally require view permission on pageFiles; CRM1 does not apply that page permission.
File type 10 is always denied by the shared read guard. Types 6, 8, and 16 bypass that guard’s session/page-files checks, while types 6, 7, and 9 bypass only its CRM2 page check after login. Routes that explicitly call the login guard still require login, and download routes still need a resolvable tenant context. A separately established shareable-link context may also bypass the shared read guard.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Positive file ID. |
type_enum | Integer-compatible | Yes | Expected positive file type; type zero is rejected. |
Example request
$details = FM_api('File_getFileDetailsByEnumAndId', ['id' => '4821', 'type_enum' => '2']);
Example response
{
"id": "4821",
"type_enum": "2",
"filename": "asset-photo.jpg",
"url": "files/2/1042/abc123"
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: id"} | ID is non-positive. |
{"error":"missing or invalid parameter: type_enum"} | Type is non-positive. |
{"error":"no such file"} | The ID/type pair does not match. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted rows are excluded. There is no pagination or storage read. The response contains database strings.
See it in Fieldmotion
CRM1
Asset detail/file controls use this lookup before presenting a saved file reference.
CRM2
No direct production CRM2 caller was found.
Related endpoints
File_getFilenameByEnumAndIdomits the URL.