soloser / vcv-php-client
VCV api v3 client for PHP
1.0.1
2023-07-26 11:39 UTC
Requires
- php: >=8.0
- ext-json: *
- fig/http-message-util: ^1.1
- guzzlehttp/guzzle: ^7.7
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6
- slevomat/coding-standard: ^8.13
README
Installation
Requires PHP 8.0+
To get started, simply require the project using Composer.
Examples
<?php require_once 'vendor/autoload.php'; $api = new Api('your_access_token'); $api->users->me();
Vacancies
//return the vacancies api $vacancies = $api->vacancies //Build filter by title request $request = (new ApiRequestBuilder()) ->withUser() ->whereTitle('(copy)') ->getRequest(); //returns list of vacancies $vacancies->list($request); //return the Vacancy 123 $vacancies->getById(123); //delete vacancy 123 $vacancies->delete(123);
Response Comments
//return current user $user = $api->users->me(); //return response comments api $comments = $api->responseComments; //Build request for filtering comments created by current user $request = (new ApiRequestBuilder()) ->whereUserId($user['user']['id']) ->setPageSize(10) ->getRequest(); //list comments by filter $response = $comments->list($request); foreach ($response['_embedded']['comments'] as $comment) { $comment['message'] = $comment['message'] . ' [UPDATED]'; //update response comment message $comments->update($comment['id'], $comment); }