PHP API wrapper for the Jazz API.
Check out the examples for a sample job listing implementation.
require "jazz-api/lib/jazz.php";
// setup with your API Key
$jazz = new Jazz("YOUR_API_KEY");
// return all Jobs
$jobs = $jazz->getJobs();
// return all Jobs without caching
$jobs = $resumator->getJobs();
// get a single Job
$job = $jazz->getJob($jobs[0]->id);
// create a job
$job_fields = array(
"title" => "New Job",
"hiring_lead_id" => "YOUR_ID",
"description" => "Join us!",
"job_status" => 2 // draft status
);
$new_job = $jazz->postJob($job_fields);
The caching mechanism can be configured and toggled on or off prior to making any API calls. By design, caching is only available for GET API calls.
Examples:
require "jazz-api/lib/jazz.php";
// setup with your API Key
$jazz = new Jazz("YOUR_API_KEY");
// set the default caching cache file expiration time (in seconds)
$jazz->cache['EXPIRES'] = 604800; // 1 week
// set the cache file save path
$jazz->cache['PATH'] = __DIR__ . DIRECTORY_SEPARATOR . "cache" . DIRECTORY_SEPARATOR;
// disable caching
$jazz->cache['ENABLED'] = false;
// enable caching
$jazz->cache['ENABLED'] = true;
- Add the
jordanandree/jazz-api
:@stable
into the require section of your composer.json. - Run
composer install
. - The example will look like this:
if (($loader = require_once __DIR__ . '/vendor/autoload.php') == null) {
die('Vendor directory not found, Please run composer install.');
}
$jazz = new Jazz("YOUR_API_KEY");
Tests are a work-in-progress and coverage could be better.
You can run tests like so:
phpunit tests/tests.php
- Fork it ( http://github.com/jordanandree/jazz-api-php/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request