Once you have created a case, it is possible to attach files to it.

To add a new attachment, create an UploadedFile using the file post data of the request and set it on the Attachment object:


/** @var \Jadu\Quantum\ServiceApiClient\Manager\AttachmentManager $attachmentManager */
$attachmentManager = $container->get('quantum_service_api_client.manager.attachment');

$file = new UploadedFile($tmpFile, basename($tmpFile), 'image/png');

$attachment = new Attachment();
$attachment->setDescription('the description of the file');


Once saved successfully, the $attachment object will be hydrated with the returned data, including a download url, the uploader (User) and an id.

The Attachment::$file property is not rehydrated after saving and should only be used when uploading a new file.

results matching ""

    No results matching ""