PHP code example of forward-force / workiz

1. Go to this page and download the library: Download forward-force/workiz 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/ */

    

forward-force / workiz example snippets


$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $jobs = $workiz->jobs()->getAll();
    var_dump($jobs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $jobs = $workiz->jobs()->take(25)->skip(10)->getAll();
    var_dump($jobs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $jobs = $workiz->jobs()->getById('your-job-uuid');
    var_dump($jobs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $jobs = $workiz->jobs()->addQueryParameter('status', 'Pending')->getAll();
    var_dump($jobs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $leads = $workiz->leads()->getAll();
    var_dump($leads);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $leads = $workiz->leads()->take(25)->skip(10)->getAll();
    var_dump($leads);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $leads = $workiz->leads()->getById('your-lead-uuid');
    var_dump($leads);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $timeOffs = $workiz->timeOffs()->getAll();
    var_dump($timeOffs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $timeOffs = $workiz->timeOffs()->take(25)->skip(10)->getAll();
    var_dump($timeOffs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}

$workiz = new \ForwardForce\Workiz\Workiz('your-token');

try {
    $timeOffs = $workiz->timeOffs()->getById('your-timeOff-uuid');
    var_dump($timeOffs);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    var_dump($e->getMessage());
}