{"id":37262328,"url":"https://github.com/communityds/deputy-api-wrapper","last_synced_at":"2026-01-15T23:20:23.439Z","repository":{"id":53517391,"uuid":"187960111","full_name":"communityds/deputy-api-wrapper","owner":"communityds","description":"PHP library that abstracts interactions with the Deputy API.","archived":false,"fork":false,"pushed_at":"2025-03-13T01:20:14.000Z","size":203,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-05T10:32:18.337Z","etag":null,"topics":["deputy","deputy-api","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/communityds.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-22T04:00:00.000Z","updated_at":"2025-03-13T01:18:27.000Z","dependencies_parsed_at":"2023-01-29T08:15:53.615Z","dependency_job_id":null,"html_url":"https://github.com/communityds/deputy-api-wrapper","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/communityds/deputy-api-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/communityds%2Fdeputy-api-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/communityds%2Fdeputy-api-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/communityds%2Fdeputy-api-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/communityds%2Fdeputy-api-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/communityds","download_url":"https://codeload.github.com/communityds/deputy-api-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/communityds%2Fdeputy-api-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deputy","deputy-api","php"],"created_at":"2026-01-15T23:20:22.610Z","updated_at":"2026-01-15T23:20:23.434Z","avatar_url":"https://github.com/communityds.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deputy API Wrapper\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/communityds/deputy-api-wrapper.svg)](https://packagist.org/packages/communityds/deputy-api-wrapper)\n[![Total Downloads](https://img.shields.io/packagist/dt/communityds/deputy-api-wrapper.svg)](https://packagist.org/packages/communityds/deputy-api-wrapper)\n![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/communityds/deputy-api-wrapper/run-tests.yml?branch=master)\n[![License](https://img.shields.io/github/license/communityds/deputy-api-wrapper.svg)](LICENSE)\n\nAllows 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.\n\n[View the documentation](docs/index.md) on how to use the wrapper.\n\n[Use the CLI tool](https://github.com/communityds/deputy-api-console) to explore the wrapper.\n\n## Installation\n\nThis package can be installed via Composer:\n\n```bash\ncomposer require communityds/deputy-api-wrapper\n```\n\nBy default, this package uses the Guzzle library to send the API requests.\nInstall the package via Composer:\n\n```bash\ncomposer require guzzlehttp/guzzle ^6.0\n```\n\nSee the [HTTP Clients documentation](docs/http_clients.md) to see what other libraries can be used instead.\n\n## Usage\n\nCreate a singleton instance of the wrapper and provide at a minimum the authentication and target component configurations:\n\n```php\nuse CommunityDS\\Deputy\\Api\\Wrapper;\n\n$wrapper = Wrapper::setInstance(\n    [\n        'auth' =\u003e [\n            'class' =\u003e 'CommunityDS\\Deputy\\Api\\Adapter\\Config\\PermanentToken',\n            'token' =\u003e '\u003cYOUR_OAUTH_TOKEN_HERE\u003e',\n        ],\n        'target' =\u003e [\n            'class' =\u003e 'CommunityDS\\Deputy\\Api\\Adapter\\Config\\TargetConfig',\n            'domain' =\u003e '\u003cYOUR_DOMAIN_HERE\u003e',\n        ],\n    ]\n);\n```\n\nUse the [helper functions](docs/resources.md) to get the records you are after.\nThe example below returns all of today's schedules/rosters:\n\n```php\n$today = mktime(0, 0, 0);\n$shifts = $wrapper-\u003efindRosters()\n    -\u003eandWhere(['\u003e=', 'startTime', $today])\n    -\u003eandWhere(['\u003c', 'endTime', strtotime('+1 day', $today)])\n    -\u003ejoinWith('employeeObject')\n    -\u003ejoinWith('operationalUnitObject')\n    -\u003eall();\nforeach ($shifts as $shift) {\n    echo date('h:ia', $shift-\u003estartTime)\n        . ' to ' . date('h:ia', $shift-\u003eendTime)\n        . ' for ' . $shift-\u003eemployeeObject-\u003edisplayName\n        . ' at ' . $shift-\u003eoperationalUnitObject-\u003edisplayName\n        . PHP_EOL;\n}\n```\n\nMore details and examples can be found in the [documentation](docs/index.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommunityds%2Fdeputy-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommunityds%2Fdeputy-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommunityds%2Fdeputy-api-wrapper/lists"}