API Client
Working with files

1CRM uses uploaded files in multiple places. You can upload files as Documents, attach files to Notes, upload Contacts and Accounts images, etc.

Files class provides methods to work with 1CRM files.

You can get an instance of Files class by calling Client::files() method:

$token = stored_access_token(); // previously obtained access token
$auth = new Authentication\OAuth($token);
$client = new APIClient\Client('https://demo.1crmcloud.com/api.php', $auth);
$files = $client->files();
Note
Files are not separate objects in 1CRM. After a file is uploaded, it is stored in a temporary location for a limited amount of time. To use uploaded file, you use its ID as a value for a field with image or file_ref type when calling Model::create() or Model::update()

Uploading files

Using uploaded files

Get information about a file

Downloading files