PHPackages                             communityds/deputy-api-wrapper - 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. communityds/deputy-api-wrapper

ActiveLibrary[API Development](/categories/api)

communityds/deputy-api-wrapper
==============================

Deputy API Wrapper

1.7.0(1y ago)522.1k↓25%4MITPHPPHP &gt;=5.6CI passing

Since May 22Pushed 1y ago4 watchersCompare

[ Source](https://github.com/communityds/deputy-api-wrapper)[ Packagist](https://packagist.org/packages/communityds/deputy-api-wrapper)[ Docs](https://github.com/communityds/deputy-api-wrapper.git)[ RSS](/packages/communityds-deputy-api-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (0)

Deputy API Wrapper
==================

[](#deputy-api-wrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/e256f092336f3e62143eb230c30918a43c1b5f77cf65f82af58f668fe0164c49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6d6d756e69747964732f6465707574792d6170692d777261707065722e737667)](https://packagist.org/packages/communityds/deputy-api-wrapper)[![Total Downloads](https://camo.githubusercontent.com/7db3607c41a98e01ac13d34395989ae5d62110bbe13e0d9840a0c4037d7e42e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6d6d756e69747964732f6465707574792d6170692d777261707065722e737667)](https://packagist.org/packages/communityds/deputy-api-wrapper)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7084e81b2ba16342e753bc4e5d5ddc6ce2a4b896c1975e89092a25bb0a58cfae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d6d756e69747964732f6465707574792d6170692d777261707065722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/7084e81b2ba16342e753bc4e5d5ddc6ce2a4b896c1975e89092a25bb0a58cfae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d6d756e69747964732f6465707574792d6170692d777261707065722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572)[![License](https://camo.githubusercontent.com/4f3c9c3db043606de253fba2e66975efd5e9335c64d813d77ea34532dbc57c3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f6d6d756e69747964732f6465707574792d6170692d777261707065722e737667)](LICENSE)

Allows interaction with the [Deputy API (Version 1)](https://www.deputy.com/api-doc/Welcome) using an object based interface that abstracts sending and receiving content from the REST API.

[View the documentation](docs/index.md) on how to use the wrapper.

[Use the CLI tool](https://github.com/communityds/deputy-api-console) to explore the wrapper.

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

[](#installation)

This package can be installed via Composer:

```
composer require communityds/deputy-api-wrapper
```

By default, this package uses the Guzzle library to send the API requests. Install the package via Composer:

```
composer require guzzlehttp/guzzle ^6.0
```

See the [HTTP Clients documentation](docs/http_clients.md) to see what other libraries can be used instead.

Usage
-----

[](#usage)

Create a singleton instance of the wrapper and provide at a minimum the authentication and target component configurations:

```
use CommunityDS\Deputy\Api\Wrapper;

$wrapper = Wrapper::setInstance(
    [
        'auth' => [
            'class' => 'CommunityDS\Deputy\Api\Adapter\Config\PermanentToken',
            'token' => '',
        ],
        'target' => [
            'class' => 'CommunityDS\Deputy\Api\Adapter\Config\TargetConfig',
            'domain' => '',
        ],
    ]
);
```

Use the [helper functions](docs/resources.md) to get the records you are after. The example below returns all of today's schedules/rosters:

```
$today = mktime(0, 0, 0);
$shifts = $wrapper->findRosters()
    ->andWhere(['>=', 'startTime', $today])
    ->andWhere(['
