PHP code example of andreybuinovskiy / php-headhunter-api
1. Go to this page and download the library: Download andreybuinovskiy/php-headhunter-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
andreybuinovskiy / php-headhunter-api example snippets
// You may need to amend this path to locate composer's autoloader
need token only
* for resources that
$vacancies = $api->vacancies->active();
// you can specify a manager, by default uses current manager
$vacancies = $api->vacancies->active($managerId);
// with pagination
$vacancies = $api->vacancies->active($managerId, ['page'=>2]);
$archived = $api->vacancies->archived();
// with pagination
$archived = $api->vacancies->archived(['page'=>2]);
$hidden = $api->vacancies->hidden();
// with pagination
$hidden = $api->vacancies->hidden(['page'=>2]);
$isInSearch = true; // or false;
$api->me->setIsInSearch($isInSearch);
$me = $api->me->info();
$managerId = $me['manager']['id'];
$preferences = $api->manager->preferences($managerId);
// automatically get manager id from your profile
$preferences = $api->manager->preferences($managerId);
$comments = $api->comments->view($applicantId);
$resumeInfo = $api->resume->view($resumeId);
$applicantCommentsUrl = $resumeInfo['owner']['comments']['url']; // https://api.hh.ru/applicant_comments/2743747
// You need to parse id from this url
// Create a comment, that is visible for coworkers
$result = $api->comments($applicantId, 'my comment');
// Create a comment, that is visible only for you
$result = $api->createPrivate($applicantId, 'my comment');
// Edit a comment, that is visible for coworkers
$api->comments->edit($applicantId, $commentId, 'new comment text')
// Edit a comment, that is visible only for you
$result = $api->editPrivate($applicantId, $commentId, 'new comment text');
$api->comments->delete($applicantId, $commentId);
$industries = $api->industries->all();
$negotiations = $api->negotiations->all();
$negotiations = $api->negotiations->active();
$api->negotiations->messages($negotiationId);
// with pagination
$api->negotiations->messages($negotiationId, ['page'=>2]);