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

ParameterTypeDescription
idGuidThe id of the File to get
returnsFileThe requested file metadata
File Get(string id);
async Task<File> GetAsync(string id);
ParameterTypeDescription
idstringThe id of the File to get
returnsFileThe 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}");
        }
    }
}