{"id":45381062,"url":"https://github.com/anorgan/onfleet-client","last_synced_at":"2026-02-21T16:45:24.023Z","repository":{"id":62486037,"uuid":"65513496","full_name":"anorgan/onfleet-client","owner":"anorgan","description":"Onfleet API Client","archived":false,"fork":false,"pushed_at":"2020-06-30T12:47:56.000Z","size":101,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-24T01:06:53.212Z","etag":null,"topics":["api","guzzle","onfleet","onfleet-client"],"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/anorgan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-12T01:33:25.000Z","updated_at":"2021-04-30T02:55:34.000Z","dependencies_parsed_at":"2022-11-02T10:15:30.701Z","dependency_job_id":null,"html_url":"https://github.com/anorgan/onfleet-client","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/anorgan/onfleet-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anorgan%2Fonfleet-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anorgan%2Fonfleet-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anorgan%2Fonfleet-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anorgan%2Fonfleet-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anorgan","download_url":"https://codeload.github.com/anorgan/onfleet-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anorgan%2Fonfleet-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29686850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["api","guzzle","onfleet","onfleet-client"],"created_at":"2026-02-21T16:45:22.572Z","updated_at":"2026-02-21T16:45:24.008Z","avatar_url":"https://github.com/anorgan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Onfleet API Client\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/anorgan/onfleet-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/anorgan/onfleet-client/?branch=master)\n[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/anorgan/onfleet-client/blob/master/LICENSE)\n[![Latest Stable Version](https://img.shields.io/packagist/v/anorgan/onfleet-client.svg?style=flat-square)](https://packagist.org/packages/anorgan/onfleet-client)\n\nPHP API Client for [Onfleet](https://onfleet.com) service\n\n## Installation\n\nInstall via [Composer](http://getcomposer.org) by running `composer require anorgan/onfleet-client ^1.0`.\n\n```json\n{\n    \"require\": {\n       \"anorgan/onfleet-client\": \"^1.0\"\n    }\n}\n```\n\n## Usage\n\n```php\n\u003c?php\n\n$onFleet = new Anorgan\\Onfleet\\Client('onFleetUserName');\n\n// Get your Organization\n$organization = $onFleet-\u003egetMyOrganization();\n\n// Create Administrator\n$adminData = [\n    'name'  =\u003e 'Marin Crnković',\n    'email' =\u003e 'marin.crnkovic@gmail.com',\n];\n$administrator = $onFleet-\u003ecreateAdministrator($adminData);\n\n// Get all administrators\n$administrators = $onFleet-\u003egetAdministrators();\n\n// Update administrator\n$administrator-\u003esetName('Updated Name');\n$updatedAdministrator = $administrator-\u003eupdate();\n\n// Delete administrator\n$updatedAdministrator-\u003edelete();\n\n// Create Worker\n$worker = $onFleet-\u003ecreateWorker([\n    'name'  =\u003e 'Worker Workowsky',\n    'phone' =\u003e '+1555123456',\n    'teams' =\u003e 'team123'\n]);\n\n// Get all workers\n$workers = $onFleet-\u003egetWorkers();\n\n// Get single worker\n$singleWorker = $onFleet-\u003egetWorker($worker-\u003egetId());\n\n// Get hubs\n$hubs = $onFleet-\u003egetHubs();\n\n// Create team\n$team = $onFleet-\u003ecreateTeam([\n    'name' =\u003e 'Team',\n    'workers' =\u003e [\n        $worker-\u003egetId(),\n        'worker2ID',\n    ],\n    'managers' =\u003e [\n        $administrator-\u003egetId(),\n    ],\n]);\n\n// Update team\n$team-\u003esetHub($hubs[0]-\u003egetId());\n$team-\u003eupdate();\n\n// Get teams\n$teams = $onFleet-\u003egetTeams();\n\n// Delete Team\n$team-\u003edelete();\n\n// Create destination\n$destination = $onFleet-\u003ecreateDestination([\n    'address' =\u003e [\n        'number'    =\u003e '543',\n        'street'    =\u003e 'Howard St',\n        'apartment' =\u003e '5th Floor',\n        'city'      =\u003e 'San Francisco',\n        'state'     =\u003e 'CA',\n        'country'   =\u003e 'USA'\n    ],\n    'notes' =\u003e \"Don't forget to check out the epic rooftop.\"\n]);\n\n// Get Destination\n$destination = $onFleet-\u003egetDestination($destination-\u003egetId());\n\n// Create recipient\n$recipient = $onFleet-\u003ecreateRecipient([\n   'name'   =\u003e 'Boris Foster',\n   'phone'  =\u003e '650-555-1133',\n   'notes'  =\u003e 'Always orders our GSC special'\n]);\n\n// Get single recipient\n$recipient = $onFleet-\u003egetRecipient($recipient-\u003egetId());\n\n// Update recipient\n$recipient-\u003esetName('Updated name');\n$recipient-\u003eupdate();\n\n// Find by name\n$recipient = $onFleet-\u003egetRecipientByName($recipient-\u003egetName());\n\n// Find by phone\n$recipient = $onFleet-\u003egetRecipientByPhone($recipient-\u003egetPhone());\n\n// Create task\n$taskArray = Task::createAutoAssignedArray($destination, $recipient);\n$task      = $onFleet-\u003ecreateTask($taskArray);\n\n// Get tasks\n$tasks = $onFleet-\u003egetTasks(time() - 20);\n\n// Get single task\n$task = $onFleet-\u003egetTask($tasks[0]-\u003egetId());\n\n// Get single task by short ID\n$task = $onFleet-\u003egetTaskByShortId($tasks[0]-\u003egetShortId());\n\n// Update task\n$task-\u003esetNotes('Updated note');\n$task-\u003eupdate();\n\n// Complete task\n$task-\u003ecomplete(true, 'Successful completion note');\n\n// Delete task\n$task-\u003edelete();\n\n// Create webhook\n$webhook = $onFleet-\u003ecreateWebhook('http://example.com/webhook/onFleet/taskCreated', Anorgan\\Onfleet\\Webhook::TRIGGER_TASK_CREATED);\n\n// Delete webhook\n$webhook-\u003edelete();\n```\n\nSetting and retrieving metadata:\n\n```php\n\u003c?php\n\n// Entity which supports metadata\n$entity-\u003esetMetadata([\n    'string'       =\u003e 'String',\n    'number'       =\u003e 123,\n    'number_float' =\u003e 12.3,\n    'boolean'      =\u003e true,\n    'object'       =\u003e [\n        'propery' =\u003e 'value'\n    ],\n    'array'        =\u003e [\n        'alpha',\n        'beta',\n        'gamma'\n    ]\n]);\n\n// Get structured metadata as API returns it\n$metadata = $entity-\u003egetMetadata();\n\n// Get normalized metadata, same as you would send to \"setMetadata\"\n$normalizedMetadata = $entity-\u003egetNormalizedMetadata();\n```\n\n## Requirements\n\nPHP 7.1 or above\n\n## Licence\n\nOnfleet PHP API client is licensed under the MIT License - see the LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanorgan%2Fonfleet-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanorgan%2Fonfleet-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanorgan%2Fonfleet-client/lists"}