carerix/cxrest-client

Client library for easy access to Carerix REST API

2.3.0 2023-11-02 10:54 UTC

This package is auto-updated.

Last update: 2024-04-07 10:27:44 UTC


README

Client library to access your Carerix application via RESTful API (https://api.carerix.com)

Installation

Recommened way is to install the library using composer:

$ composer require carerx/cxrest-client  

Basic usage

Bootstrapping:

use Carerix\Api\Rest\Client;
use Carerix\Api\Rest\Manager;
use Carerix\Api\Rest\Entity;

$client = new Client();

$manager = new Manager($client);
$manager->autoDiscoverEntities();

$manager->setUsername(CUSTOMER_NAME);
$manager->setPassword(API_TOKEN);

Entity::setManager($manager);

Usage (after entity manager was bootstrapped correctly):

use Carerix\Api\Rest\Entity\CREmployee;
use Carerix\Api\Rest\Entity\CRUser;

// get user by ID
$user = CRUser::find(125);

// apply for a job
$params = array('x-cx-pub' => PUBLICATION_ID_GOES_HERE);

$employee = new CREmployee();
$employee
    ->setFirstName('John')
    ->setLastName('Smith');
$employee->apply($params); 

Resources

To access these resources you'll have to apply a partner developer account.

License

All contents of this project is licensed under the MIT license. See LICENSE file for details.

Acknowledgements

This project is highly inspired by Doctrine's (www.doctrine-project.org) implementation of the ActiveRecord pattern and Doctrine REST API Client.