Syntax
array getFileById( string api_key, int file_id );
Parameters
api_key
(string)The key required to access the API. See Getting Started for more information.
file_id
(int)The File ID
Return Value
Returns an array containing a single associative array of File details. See searchFiles for a description of the values returned.
Examples
Get the details of a File ID 1414651
$api = new Api($url, 'YOURAPIKEY');
$file_id = 1414651;
$file = $api->invokeMethod('getFileById', $file_id);
$file_id = 1414651;
$file = $api->invokeMethod('getFileById', $file_id);
{
"id": 1,
"method": "getFileById",
"params": [
"YOURAPIKEY",
1414651
]
}
"id": 1,
"method": "getFileById",
"params": [
"YOURAPIKEY",
1414651
]
}
{
"id": 1,
"result": [
{
"id": "1414651",
"folder_id": "123456",
"basename": "image",
"extension": ".png",
"size": "24",
"creation_time": "1362353401",
"image_width": "0",
"image_height": "0",
"mime_type": "image\/png",
"last_modified_time": "1362353401",
"last_modified_user_id": "50247",
"name": "image.png",
"url": "http:\/\/example.com\/image.png"
}
],
"error": null
}
"id": 1,
"result": [
{
"id": "1414651",
"folder_id": "123456",
"basename": "image",
"extension": ".png",
"size": "24",
"creation_time": "1362353401",
"image_width": "0",
"image_height": "0",
"mime_type": "image\/png",
"last_modified_time": "1362353401",
"last_modified_user_id": "50247",
"name": "image.png",
"url": "http:\/\/example.com\/image.png"
}
],
"error": null
}
Error Codes
This method may return the following error code in addition to the standard error codes:
Code | Error | Description |
---|---|---|
379 |
Unable to Load File | file_id is not valid |