Get a File
Get metadata for a File by ID.
Permissions Required
You must have View permissions to the field this file was uploaded to for this request to succeed
Method Signature
File Get(Guid id);
async Task<File> GetAsync(Guid id);
Parameters
Parameter | Type | Description |
---|---|---|
id | Guid | The id of the File to get |
returns | File | The requested file metadata |
File Get(string id);
async Task<File> GetAsync(string id);
Parameter | Type | Description |
---|---|---|
id | string | The id of the File to get |
returns | File | The requested file metadata |
Example
/*
* This example demonstrates getting a File's metadata by ID
*/
using Catalytic.Sdk.Entities;
namespace Catalytic.Sdk.Examples
{
class Program
{
static void Main(string[] args)
{
var catalytic = new Catalytic.Sdk.CatalyticClient(Credentials.Default);
var file = catalytic.Files.Get("e6df431b-1041-4326-89e5-1e14caa6a08f");
Console.WriteLine($"Name: ${file.Name}");
Console.WriteLine($"Size: ${file.DisplaySize}");
Console.WriteLine($"Content-Type: ${file.ContentType}");
}
}
}
Updated almost 4 years ago