Employees

Make sure you familiarize yourself with the following important concepts of our API:
Prices and Quantities, Products and Articles, Sync Markers
After taking the time to understand these concepts, you will much better understand the basics of our API.

Contents

getEmployees Retrieve employees

Use this function to retrieve a complete or partial list of all available employees.
You can specify a syncMarker to limit the results to changed employees since a specific moment.

<?php

require_once('Mplusqapiclient.php');

$mplusqapiclient = new Mplusqapiclient();
// Initialize the client with your details.

$employeeNumbers = array();
$syncMarker = 0;

// Then we call the getEmployees() function wrapped in a try/catch block to intercept any exceptions.
try {
  if (false !== ($employees= $mplusqapiclient->getEmployees($employeeNumbers,$syncMarker))) {
    // Success, we show the number of retrieved employees.
    exit(sprintf('Retrieved %d employees.', count($employees)));
  } else {
    exit('Unable to retrieve employees.');
  }
} catch (MplusQAPIException $e) {
  exit($e->getMessage());
}

getShifts Retrieving shifts (working hours)

<?php

require_once('Mplusqapiclient.php');

$mplusqapiclient = new Mplusqapiclient();
// Initialize the client with your details.
(...)

// Then we call the getShifts() function wrapped in a try/catch block to intercept any exceptions.
try {
  if (false !== ($orders = $mplusqapiclient->getShifts($syncMarker))) {
    // Success, we show the number of retrieved shifts.
    exit(sprintf('Retrieved %d shifts.', count($shifts)));
  } else {
    exit('Unable to retrieve shifts.');
  }
} catch (MplusQAPIException $e) {
  exit($e->getMessage());
}