PHP code example of vmeretail / servicedeskify-php-sdk
1. Go to this page and download the library: Download vmeretail/servicedeskify-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vmeretail / servicedeskify-php-sdk example snippets
use VmeRetail\ServiceDeskify\Data\CreateIncidentData;
use VmeRetail\ServiceDeskify\Enums\IncidentPriority;
use VmeRetail\ServiceDeskify\Facades\ServiceDeskify;
$incident = ServiceDeskify::incidents()->create(new CreateIncidentData(
title: 'Till 2 is not rebooting',
details: 'Till 2 remains offline after a restart.',
storeNumber: 722,
priority: IncidentPriority::P1,
));
use VmeRetail\ServiceDeskify\Data\IncidentClosureData;
use VmeRetail\ServiceDeskify\Data\IncidentQueryData;
use VmeRetail\ServiceDeskify\Enums\IncidentStatus;
$openIncidents = ServiceDeskify::incidents()->all(new IncidentQueryData(
status: IncidentStatus::Open,
));
$incident = ServiceDeskify::incidents()->find(123);
ServiceDeskify::incidents()->addClosureDetails(123, new IncidentClosureData(
symptom: 'Till could not connect',
symptomSolution: 'Restarted the service',
cause: 'The service had stopped',
permanentResolution: 'Monitoring has been added',
));
ServiceDeskify::incidents()->close(123);
foreach (ServiceDeskify::incidents()->lazy() as $incident) {
// Process one incident at a time.
}
use Illuminate\Http\UploadedFile;
use VmeRetail\ServiceDeskify\Data\CreateIncidentPostData;
$reply = ServiceDeskify::incidents()->posts(123)->create(
new CreateIncidentPostData(
details: 'The requested log is attached.',
attachments: [
new UploadedFile('/tmp/till.log', 'till.log'),
],
),
);