This PHP class provides an easy way to interact with the Recruitee API, allowing you to create candidates and set their custom fields.
Simply include the Recruitee.php file in your project.
require_once 'Recruitee.php';$companyId = 'your_company_id';
$token = 'your_api_token';
$recruitee = new Recruitee($companyId, $token);if ($recruitee->checkConnection()) {
echo "Connection successful!";
} else {
echo "Failed to connect.";
}$candidateData = [
"name" => "John Smith",
"emails" => ["john@example.com"],
"phones" => ["123123123"],
"social_links" => ["https://www.facebook.com/johnexamplecom/"],
"links" => ["https://www.example.com/"],
"cover_letter" => "Example cover letter"
];
$candidateId = $recruitee->createCandidate($candidateData);
if ($candidateId) {
echo "Candidate created with ID: $candidateId";
} else {
echo "Failed to create candidate.";
}$recruitee->addCustomFieldToCandidate($candidateId, 'Meine fräge die i hätt', 'Das i 1 antwort');
$recruitee->addCustomFieldToCandidate($candidateId, 'Lange tekst', 'lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet', Recruitee::MULTI_LINE);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', 'male', Recruitee::GENDER);$recruitee->addCustomFieldToCandidate($candidateId, 'Alpha?', true, Recruitee::BOOLEAN);
$recruitee->addCustomFieldToCandidate($candidateId, 'Designer?', false, Recruitee::BOOLEAN);$recruitee->addCustomFieldToCandidate($candidateId, 'Unnödeg', 'Jägerstraße 13, 31535 Neustadt', Recruitee::ADDRESS);
$recruitee->addCustomFieldToCandidate($candidateId, 'Gehald', 10500, Recruitee::NUMBER);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', 'NL', Recruitee::NATIONALITY);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', [
['language_code' => 'en', 'level' => 'advanced'],
['language_code' => 'de', 'level' => 'native'],
], Recruitee::LANGUAGE_SKILL);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', [
['text' => 'SQL'],
['text' => 'PHP'],
['text' => 'HTML'],
], Recruitee::SKILLS);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', '1988-03-07', Recruitee::DATE_OF_BIRTH);
$recruitee->addCustomFieldToCandidate($candidateId, 'Mauerfall', '1989-02-28', Recruitee::DATE);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', [
['title' => 'Ausbildung ITSE', 'company' => 'Telekom', 'location' => 'Hannover', 'description' => 'Ausbildung zum IT-SE', 'startDate' => '2004-08-01', 'endDate' => '2007-07-30'],
['title' => 'Arbeit', 'company' => 'Telekom', 'location' => 'Wunstorf', 'description' => 'Systemelektronika', 'startDate' => '2007-08-01', 'endDate' => '2018-07-30'],
], Recruitee::EXPERIENCE);$recruitee->addCustomFieldToCandidate($candidateId, 'unnödeg', [
['school' => 'Compers', 'degree' => 'OP Professional', 'description' => 'Sonen Lehrgang', 'major' => 'Major?', 'startDate' => '01.08.2012', 'endDate' => '30.07.2014'],
], Recruitee::EDUCATION);$offers = $recruitee->getOffers();
print_r($offers);This project is licensed under the MIT License.