PHP code example of artarts36 / head-hunter-api

1. Go to this page and download the library: Download artarts36/head-hunter-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/ */

    

artarts36 / head-hunter-api example snippets


use ArtARTs36\HeadHunterApi\Client;
use ArtARTs36\HeadHunterApi\Features\Vacancy\Vacancy;

$client = new Client('https://api.hh.ru', 'MyApp/[email protected]');
$feature = new Vacancy($client);
$vacancy = $feature->find(123456789);

var_dump($vacancy->getSpecializations());

$app->singleton(
    \ArtARTs36\HeadHunterApi\Contracts\Client::class,
    function () {
        return new \ArtARTs36\HeadHunterApi\Client(
              env('HEADHUNTER_API_BASE_URL'),
              env('HEADHUNTER_API_USER_AGENT')
        );
    }
);