Find Files
Preview Release
The PHP SDK is currently a preview release and is not yet generally available. Please contact [email protected](opens in new tab) if you would like early access.
The Find Method
Find Files matching your criteria.
Permissions Required
You must have Find permissions to a matching file for it to be included in the results
FilesPage find(Filter $filter = null, string $pageToken = null, int $pageSize = null)
Parameter | Type | Description |
---|---|---|
$filter | Catalytic\SDK\Search\Filter | The filter criteria to search by, or null to fetch all Files. |
$pageToken | string | The token of the page to fetch |
$pageSize | int | The number of Instances to return per page |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
text | string | Fuzzy matches the file Name. |
owner | string | Search for Files created by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing. |
pushbotId | string | Find Files attached to a specific Pushbot |
instanceId | string | Find Files attached to a specific Instance |
<?php
/*
* This example demonstrates finding all Files in a specific
* Instance uploaded by a particular user.
* This also demonstrates paging through results to collect all
* matches into a single list.
*/
using Catalytic.Sdk.Entities;
using System.Collections.Generic;
namespace Catalytic.Sdk.Examples
{
class Program
{
static void Main(string[] args)
{
var catalytic = new Catalytic.Sdk.Client(Credentials.Default);
var files = new List<File>();
var paging = new PagingOptions { Size = 25 };
while(paging != null)
{
var result = catalytic.Instances.Find(
Where
.InstanceId.Is("c9f2beec-10c0-4f2f-b4e0-1d884c7e053c")
.And.Owner.Is("[email protected]"),
paging
);
files.AddRange(result.Files);
paging = result.NextPageOptions;
}
// files now contains all matching Files
}
}
}
Updated over 3 years ago