PHP code example of chrisjohnleah / eworks-manager-api

1. Go to this page and download the library: Download chrisjohnleah/eworks-manager-api 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/ */

    

chrisjohnleah / eworks-manager-api example snippets


use ChrisJohnLeah\EworksManager\EworksClient;

$client = EworksClient::fromArray([
    'username' => $username,
    'api_key' => $apiKey,
]);

$customers = $client->get('customers');
foreach ($customers->records() as $customer) {
    // Provider data only: map it in the consuming application.
}

$workorders = $client->workorders();
$notes = $client->workorderLogs('WO-100');
$purchaseOrders = $client->purchaseOrders();
$purchaseOrderLines = $client->purchaseOrderLineItems('PO-100');

$created = $client->postWorkorder([
    'title' => 'Automatic door inspection',
    'type_num' => 2,
    'type_desc' => 'Preventive Maintenance',
    'type_short' => 'PM',
]);