Retrieve
Retrieve
client.files.retrieve(stringfileId, RequestOptionsoptions?): idstringlinksLinksnamestringpathstringtypeunionupdatedAtstringversionnumberFileRetrieveResponse
get/v2/files/{file_id}
Get file metadata by file ID
Parameters
fileIdstring
Returns
FileRetrieveResponse
A File or Directory's Metadata
import ValTown from '@valtown/sdk';
const client = new ValTown();
const file = await client.files.retrieve('file_id');
console.log(file.id);
200 Example
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"links": {
"html": "https://example.com",
"module": "https://example.com",
"self": "https://example.com",
"endpoint": "https://example.com"
},
"name": "name",
"path": "path",
"type": "directory",
"updatedAt": "2019-12-27T18:11:19.117Z",
"version": 0
}