DoYouBuzz API Helper
If you want to use DoYouBuzz in your PHP project this project can help you., (*1)
Install
You can install this library by using Packagist., (*2)
Add the following to your
composer.json file. Composer will handle the autoloading., (*3)
{
"require": {
"doyoubuzz/api-helper": "dev-master"
}
}
Usage
<?php
// include your autoloader then :
$apiKey = 'XXX';
$apiSecret = 'YYY';
$dyb = new \DoYouBuzz\ApiHelper\DoYouBuzzAPI($apiKey, $apiSecret);
$dyb->connect(true);
$user = $dyb->getUser();
if ($user) {
echo 'Utilisateur : ' . $user->firstname . ' ' . $user->lastname . '<br>';
$mainCv = $dyb->getMainCv();
if ($mainCv) {
echo 'Cv : ' . $mainCv->title . '<br>';
}
}
Methods
List of methods you can use :
- getUser : Return a \stdClass with the user's data (and CV with their titles)
- getMainCv : Return the main CV as \stdClass
- getCv(:id) : Give an id and get the CV as \stdClass
- getStatistics : Return user's statistics
- getEmploymentPreferences : Return user's employment preferences
- getDisplayOptions(:id, :type) : Return the display option for the given type (web, mobile, print)
- getAccessToken : Return the access token
- setAccessToken(:token, :secret): You can set the access token
- clearAll : remove all data in storage (Session by default)
- connect(:redirect = false, :callbackUrl) : Will connect your user and get the access token, (*4)
If you want to know the properties available on \stdClass see json format on our doc., (*5)