PHP code example of brianfreytag / ultipro-sdk-php

1. Go to this page and download the library: Download brianfreytag/ultipro-sdk-php 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/ */

    

brianfreytag / ultipro-sdk-php example snippets


use Ultipro\Authentication;
use Ultipro\UltiproClient;

$username = 'my-username';
$password = 'my-password';
$customerApiKey = 'XY0XY';

$authorization = new Authentication($username, $password, $customerApiKey);

$client = new UltiproClient($authorization);

use Ultipro\UltiproClient;

$username = 'my-username';
$password = 'my-password';
$customerApiKey = 'XY0XY';

$authorization = [
    'username'         => $username,
    'password'         => $password,
    'customer_api_key' => $customerApiKey
];

$client = new UltiproClient($authorization);


use Ultipro\Personnel\PersonnelClient;
use Ultipro\Authentication;
use Ultipro\Personnel\Query\PersonDetailQuery;
use Ultipro\Personnel\Model\PersonDetail;
use Ultipro\Personnel\PersonnelResponse;
use Ultipro\Request;

$username = 'my-username';
$password = 'my-password';
$customerApiKey = 'XY0XY';

$authorization = new Authentication($username, $password, $customerApiKey);

$personnelClient = new PersonnelClient($authorization);

$request = new Request();

$query = new PersonDetailQuery();
$query->setEmployeeId('BM410003');

$request->setQueryParameters($query);

/** @var PersonnelResponse $response */
$response = $personnelClient->getPersonDetails($request);

/** @var PersonDetail $personDetail */
foreach ($response->getContent() as $personDetail) {
    $firstName = $personDetail->getFirstName();
}


composer