PHPackages                             gamez/personio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gamez/personio

AbandonedArchivedLibrary[API Development](/categories/api)

gamez/personio
==============

Interact with Personio (https://www.personio.de) from your PHP application.

2.0(5y ago)798.2k↓28.8%1MITPHPPHP &gt;=7.4

Since Jan 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jeromegamez/personio-php)[ Packagist](https://packagist.org/packages/gamez/personio)[ Docs](https://github.com/jeromegamez/personio-php)[ GitHub Sponsors](https://github.com/jeromegamez)[ RSS](/packages/gamez-personio/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

Personio SDK for PHP
====================

[](#personio-sdk-for-php)

Note

I don't have developer access to Personio anymore, so I can't continue to maintain this project.

Interact with [Personio](https://www.personio.de) from your PHP application.

[![Current version](https://camo.githubusercontent.com/2fba5abfbfaabbdf5a2c1daa7130139713232da5a37bc90dcfe912eff56ce90d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67616d657a2f706572736f6e696f2e737667)](https://packagist.org/packages/gamez/personio)[![Supported PHP version](https://camo.githubusercontent.com/820b85956a5b0338007e60d5c3996dc7244c3ed0233655b099041178f4d7286b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67616d657a2f706572736f6e696f2e737667)](https://camo.githubusercontent.com/820b85956a5b0338007e60d5c3996dc7244c3ed0233655b099041178f4d7286b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67616d657a2f706572736f6e696f2e737667)[![Build Status](https://camo.githubusercontent.com/6c5ff1b7b55d373df56765151e6a0c4da7a51a1cb23ae59a45eddc6fe5dcf020/68747470733a2f2f7472617669732d63692e636f6d2f6a65726f6d6567616d657a2f706572736f6e696f2d7068702e7376673f6272616e63683d322e78)](https://travis-ci.com/jeromegamez/personio-php)[![Discord](https://camo.githubusercontent.com/fe8a78d5e2cefe22846d36f43bb41909ef2f1ee8cb7241a21a900a2b1492e0f9/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3830373637393239323537333232303932352e7376673f636f6c6f723d373238396461266c6f676f3d646973636f7264)](https://discord.gg/Yacm7unBsr)[![Sponsor](https://camo.githubusercontent.com/1004a94551d1edaf2a6da4d45ba217b79a46eb18dd7dd2d7825add0a2a8ddc4f/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d476974487562266c6162656c3d53706f6e736f72266d6573736167653d25453225394425413426636f6c6f723d666636396234)](https://github.com/sponsors/jeromegamez)

---

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Basic API client](#basic-api-client)
    - [Simple API](#simple-api)
    - [Catching errors](#catching-errors)
    - [Caching HTTP requests](#caching-http-requests)
    - [Creating your own API client](#creating-your-own-api-client)
- [License](#license)

---

Requirements
------------

[](#requirements)

- A Client ID and Client Secret (You can generate them at )

---

Installation
------------

[](#installation)

In order to use this library, you need a [PSR-18 HTTP Client](https://packagist.org/providers/psr/http-client-implementation), and a [PSR-17 HTTP Message Factory](https://packagist.org/providers/psr/http-factory-implementation).

### Example using `kriswallsmith/buzz` and `nyholm/psr7`

[](#example-using-kriswallsmithbuzz-and-nyholmpsr7)

```
composer require kriswallsmith/buzz nyholm/psr7 gamez/personio
```

```
$requestFactory = new \Nyholm\Psr7\Factory\Psr17Factory();
$httpClient = new \Buzz\Client\FileGetContents($requestFactory);
```

### Example using `guzzlehttp/guzzle` and `laminas/laminas-diactoros`

[](#example-using-guzzlehttpguzzle-and-laminaslaminas-diactoros)

```
composer require guzzlehttp/guzzle laminas/laminas-diactoros gamez/personio
```

```
$requestFactory = new \Laminas\Diactoros\RequestFactory();
$httpClient = new \GuzzleHttp\Client();
```

---

Usage
-----

[](#usage)

### Basic API client

[](#basic-api-client)

Once you have created an HTTP Client and Request Factory as described in the installation section, you can create an API client with them:

```
use Gamez\Personio\Api\HttpApiClient;

$clientId = 'xxx';
$clientSecret = 'xxx';

/**
 * @var \Psr\Http\Message\RequestFactoryInterface $requestFactory
 * @var \Psr\Http\Client\ClientInterface $httpClient
 */
$apiClient = HttpApiClient::with($clientId, $clientSecret, $httpClient, $requestFactory);
```

This API client allows you to make authenticated HTTP requests to the API of your Personio account - see [Personio's REST API documentation](https://developer.personio.de/reference) for the endpoints you can use.

### Simple API

[](#simple-api)

[`Gamez\Personio\SimpleApi`](./src/SimpleApi.php) is the easiest and fastest way to access the data in your Personio account. Its methods are named after the [available REST API endpoints](https://developer.personio.de/v1.0/reference)and return arrays of data. You can inspect the available methods by looking at the [source code of the `Gamez\Personio\SimpleApi` class](./src/SimpleApi.php) or by using the autocompletion features of your IDE.

The Simple API doesn't get in your way when accessing the Personio API, but it doesn't provide additional features either. It will, for example, not tell you if you used a wrong query parameter or invalid field value, so you will have to rely on the returned API responses.

For information on which query parameters and field values are allowed, see [Personio Developer Hub](https://developer.personio.de/v1.0/reference).

### Catching errors

[](#catching-errors)

All exceptions thrown by this library implement the `\Gamez\Personio\Exception\PersonioException` interface. Exceptions thrown while using an API Client will throw a `\Gamez\Personio\Exception\ApiClientError`.

```
