This is a simple PHP wrapper for the Traklight API. This wrapper supports creating users and auto-logging users into their Traklight dashboard.
$tk = new TraklightApiWrapper('your_subdomain','your_auth_key');
$tk->useStaging = true; # Optionally use Traklight test server
$users = $tk->getUsers();
var_dump($users);
$user = $tk->getUser('user_id');
var_dump($user);
$user = $tk->createUser(Array(
'email' => '[email protected]', # required
'firstName' => 'Joe', # required
'lastName' => 'Example', # required
'timeZone' => 'America/Phoenix', # optional default "UTC"
'password' => 'foobarFB1', # required
'phoneNumber' => '555-555-555', # optional default "555-555-5555"
'postalCode' => '85003', # optional default "00000"
'countryCode' => 'US', # required
));
var_dump($user);
- timeZone - must be a value from the tz database
- password - minLength=8, minNumLower=1, minNumUpper=1, minNumDigit=1
- countryCode - must be 2 character ISO code
<?php $url = $tk->getSessionUrl('[email protected]'); ?>
<iframe
id="traklight_iframe"
style="height: 100%; width: 100%"
src="<?= $url ?>"
name="traklight_app"
sandbox="allow-same-origin allow-forms allow-scripts allow-popups allow-top-navigation"
seamless>
</iframe>