{"id":39343309,"url":"https://github.com/inshore/bookwhen","last_synced_at":"2026-02-14T17:08:08.017Z","repository":{"id":56991993,"uuid":"282869271","full_name":"inshore/bookwhen","owner":"inshore","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-03T10:18:07.000Z","size":493,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-06-18T07:17:48.016Z","etag":null,"topics":["api","bookwhen","packagist","php","sdk","sdk-php"],"latest_commit_sha":null,"homepage":"https://inshore.je","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/inshore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-27T10:53:07.000Z","updated_at":"2023-06-13T16:24:55.000Z","dependencies_parsed_at":"2023-10-03T18:11:12.640Z","dependency_job_id":null,"html_url":"https://github.com/inshore/bookwhen","commit_stats":{"total_commits":164,"total_committers":2,"mean_commits":82.0,"dds":"0.21341463414634143","last_synced_commit":"63f63f95b480dacde74af65d94a1104f7e3a58e0"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/inshore/bookwhen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inshore%2Fbookwhen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inshore%2Fbookwhen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inshore%2Fbookwhen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inshore%2Fbookwhen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inshore","download_url":"https://codeload.github.com/inshore/bookwhen/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inshore%2Fbookwhen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","bookwhen","packagist","php","sdk","sdk-php"],"created_at":"2026-01-18T02:18:58.380Z","updated_at":"2026-02-14T17:08:08.010Z","avatar_url":"https://github.com/inshore.png","language":"PHP","funding_links":["https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js","https://www.buymeacoffee.com/danielmullin"],"categories":[],"sub_categories":[],"readme":"# inShore.je - Bookwhen PHP API SDK\n\n[![Latest Version](https://img.shields.io/github/release/inshore/bookwhen.svg?style=flat-square)](https://github.com/inshore/bookwhen/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/inshore/bookwhen.svg?style=flat-square)](https://scrutinizer-ci.com/g/inshore/bookwhen/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/inshore/bookwhen.svg?style=flat-square)](https://scrutinizer-ci.com/g/inshore/bookwhen)\n[![Total Downloads](https://img.shields.io/packagist/dt/inshore/bookwhen.svg?style=flat-square)](https://packagist.org/packages/inshore/bookwhen)\n\nSDK for the [Bookwhen API](https://api.bookwhen.com/v2). Requires PHP 8.3+.\n\n- [Bookwhen](https://www.bookwhen.com) · [API v2](https://api.bookwhen.com/v2)\n- **[Changelog](CHANGELOG.md)** — upgrade notes and breaking changes (e.g. v1.0.0)\n\n## Install\n\n### Requirements\n\nPHP 8.3 and later.\n\n**Composer**\n\n``` bash\n$ composer require inshore/bookwhen\n\n```\n\n## Usage\n\nSimply expose your Bookwhen API key as the environment property \n\nINSHORE_BOOKWHEN_API_KEY \n\nvia .env or how you prefer.\n\n\n``` php\n$bookwhen = new Bookwhen();\n```\n### Attachments\n\nimplements [https://api.bookwhen.com/v2#tag/Attachment](https://api.bookwhen.com/v2#tag/Attachment)\n\nAttachments\n\nhttps://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments/get\n\n``` php\n\n// Fetch attachments accessible by the API token.\n\n$attachments = $bookwhen-\u003eattachments();\n```\n\n**Filters**\n\nThe filter parameters can be passed in as function parameters.\n\n**title** - Filter on the file title text.\n\n**fileName** - Filter on the file name.\n\n**fileType** - Filter on the file type.\n\n``` php\n\n// Fetch attachments accessible by the API token.\n\n$attachments = $bookwhen-\u003eattachments(fileName: 'CV'));\n\n$attachments = $bookwhen-\u003eattachments(fileType: 'pdf'));\n\n$attachments = $bookwhen-\u003eattachments(title: 'Title to filter by'));\n\n$attachments = $bookwhen-\u003eattachments(fileName: 'CV', fileType: 'pdf', title: 'Title to filter by'));\n```\n\nAttachment\n\n[https://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments~1%7Battachment_id%7D/g](https://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments~1%7Battachment_id%7D/get)\n\n```\n// Returns the attachment for the provided attachment ID.\n\n$attachment = $bookwhen-\u003eattachment('ev-smij-20200530100000' );\n\n```\n###Class Passes\n\nimplements [https://api.bookwhen.com/v2#tag/ClassPass](https://api.bookwhen.com/v2#tag/ClassPass)\n\nClassPasses\n\nhttps://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes/get\n\n``` php\n\n// Fetch class passes accessible by the API token.\n\n$classPasses = $bookwhen-\u003eclassPasses();\n\n```\n\n**Filters**\n\nThe filter parameters can be passed in as function parameters\n\n**title** - Filter on the title text of the pass.\n\n**detail** - Filter on the details text.\n\n**usageType** - Filter on the type of the pass: personal or any.\n\n**cost** - Filter on the cost with an exact value or use a comparison operator. e.g. filter[cost][gte]=2000\n\n  **gt** - greater than\n\n  **gte** - greater than or equal\n\n  **lt** - less than\n\n  **lte** - less than or equal\n\n  **eq** - equal to\n\n**usageAllowance** - Filter on pass usage allowance. This also accepts a comparison operator like cost.\n\n**useRestrictedForDays** - Filter on pass days restriction. This also accepts a comparison operator like cost.\n\n``` php\n\n// Fetch class passes accessible by the API token.\n\n$classPasses = $bookwhen-\u003eclassPasses();\n\n$classPasses = $bookwhen-\u003eclassPasses(title: 'Title to filter by'));\n```\n\nClassPass\n\nhttps://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes~1%7Bclass_pass_id%7D/get\n\n``` php\n\n// Returns the class pass for the provided class pass ID.\n\n$classPass = $bookwhen-\u003eclassPass('ev-smij-20200530100000');\n\n```\n\n### Events\n\n[https://api.bookwhen.com/v2#tag/Event](https://api.bookwhen.com/v2#tag/Event)\n\nEvents\n\n[https://api.bookwhen.com/v2#tag/Event/paths/~1events/get](https://api.bookwhen.com/v2#tag/Event/paths/~1events/get)\n\n``` php\n\n// Returns the event for the provided event ID.\n\n$event = $bookwhen-\u003eevents();\n\n```\n\n**Filters**\n\n**calendar** - Restrict to events on the given calendars (schedule pages).\n\n**entry** - Restrict to given entries.\n\n**location** - Array of location slugs to include.\n\n**tag** - Array of tag words to include.\n\n**title** - Array of entry titles to search for.\n\n**detail** - Array of entry details to search for.\n\n**from** - Inclusive time to fetch events from in format YYYYMMDD or YYYYMMDDHHMISS. Defaults to today.\n\n**to** - Non-inclusive time to fetch events until in format YYYYMMDD or YYYYMMDDHHMISS\n\n**compact** - Boolean: Combine events in a course into a single virtual event.\n\n**Includes**\n\nBy default the event will NOT have its attachments, location and tickets populated.\n\nTo retrieve an event with the included relationships,\nsimply pass boolean true for the relationship that is required. \n\nincludeAttachments\nincludeLocation\nincludeTickets\nincludeTickets.class_passes\nincludeTickets.events\n\nfor example to retrieve the event with its location and tickets.\n\n``` php\n\n// Returns the event for the provided event ID.\n\n$event = $bookwhen-\u003eevents(title: ['Title to filter by']);\n\n```\n\nEvent\n\n[https://api.bookwhen.com/v2#tag/Event/paths/~1events~1%7Bevent_id%7D/get](https://api.bookwhen.com/v2#tag/Event/paths/~1events~1%7Bevent_id%7D/get)\n\n``` php\n\n// Returns the event for the provided event ID.\n\n$event = $bookwhen-\u003eevent('ev-smij-20200530100000');\n\n```\n\n\n``` php\n\n// Returns the event for the provided event ID.\n\n$event = $bookwhen-\u003eevent(eventId: 'ev-smij-20200530100000', includeLocation: true, includeTickets: true);\n\n```\n\n###Events###\n\n``` php\n\n// Fetch events accessible by the API token.\n\n$events = $bookwhen-\u003eevents();\n\n```\n\n**Filters**\n\nThe event list can be filtered as per the api documentation\n\n**Includes**\n\nBy default the event will NOT have its attachments, location and tickets populated.\n\nTo retrieve an event withg the included relationships,\nsimply pass boolean true for the relationship that is required. \n\n**includeAttachments**\n**includeLocation**\n**includeTickets.class_passes**\n**includeTickets.events**\n\nfor example to retrieve the event with its location and tickets.\n\n\n\n``` php\n\n// Fetch events accessible by the API token.\n\n$events = $bookwhen-\u003eevents(includeLocation: true, includeTickets: true);\n\n```\n\n\n### Locations\n\n\nImplements [https://api.bookwhen.com/v2#tag/Location](https://api.bookwhen.com/v2#tag/Location)\n\nLocations\n\n[https://api.bookwhen.com/v2#tag/Location/paths/~1locations/get](https://api.bookwhen.com/v2#tag/Location/paths/~1locations/get)\n\n``` php\n\n// Fetch events accessible by the API token.\n\n$locations = $bookwhen-\u003elocations();\n\n// Returns the location for the provided location ID.\n\n```\n\n**Filters**\n\n**addressText** - Restrict to locations containing the address text filter.\n\n**additionalInfo** - Filter by the text contained in the additional info.\n\n``` php\n\n// Fetch events accessible by the API token.\n\n$locations = $bookwhen-\u003elocations(addressText: 'Remote'));\n\n// Returns the location for the provided location ID.\n\n```\n\nLocation\n\n[https://api.bookwhen.com/v2#tag/Location/paths/~1locations~1%7Blocation_id%7D/get](https://api.bookwhen.com/v2#tag/Location/paths/~1locations~1%7Blocation_id%7D/get)\n\n```php\n// Returns the location for the provided location ID.\n\n$location = $bookwhen-\u003elocation('ev-smij-20200530100000');\n\n```\n\n### Tickets\n\nImplements [https://api.bookwhen.com/v2#tag/Ticket](https://api.bookwhen.com/v2#tag/Ticket)\n\nTickets\n\n[https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets/get](https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets/get)\n\n\n``` php\n\n// Fetch tickets for the given event.\n\n$eventId = 'ev-smij-20200530100000';\n\n$client-\u003etickets($eventId);\n```\n\n**Includes**\n\nBy default the tickets will NOT have its attachments, evetns and location populated.\n\nTo retrieve an event withg the included relationships,\nsimply pass boolean true for the relationship that is required. \n\n**includeAttachments**\n**includeLocation**\n**includeTickets.class_passes**\n**includeTickets.events**\n\n``` php\n\n// Fetch tickets for the given event.\n\n$eventId = 'ev-smij-20200530100000';\n\n$client-\u003etickets($eventId, includeAttachments: true);\n```\n\nTicket\n\n[https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets~1%7Bticket_id%7D/get](https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets~1%7Bticket_id%7D/get)\n\n``` php\n// Retrieve a single ticket.\n\n$ticketId = 'ti-sboe-20200320100000-tk1m';\n\n$client-\u003eticket($ticketId);\n\n```\n\n**Includes**\n\nBy default the tickets will NOT have its attachments, evetns and location populated.\n\nTo retrieve an event withg the included relationships,\nsimply pass boolean true for the relationship that is required. \n\n**includeAttachments**\n**includeLocation**\n**includeTickets.class_passes**\n**includeTickets.events**\n\n``` php\n// Retrieve a single ticket.\n\n$client-\u003eticket('ti-sboe-20200320100000-tk1m', includeEventsAttachments: true);\n\n```\n\n## Logging\n\nFull syslog level logging is available and can be enabled by passing a level in when instatiating the Client. As illustrated in RFC 5424 which describes the syslog protocol, the following levels of intensity are applied.\n\nDEBUG: Detailed debugging information.\nINFO: Handles normal events. Example: SQL logs\nNOTICE: Handles normal events, but with more important events\nWARNING: Warning status, where you should take an action before it will become an error.\nERROR: Error status, where something is wrong and needs your immediate action\nCRITICAL: Critical status. Example: System component is not available\nALERT: Immediate action should be exercised. This should trigger some alerts and wake you up during night time.\nEMERGENCY: It is used when the system is unusable.\n\n$bookwhen = new Bookwhen()-\u003edebug('Debug');\n\n\n## Testing\n\nWIP\n\n``` bash\n$ composer phpunit\n```\n\n## Contributing\n\nPlease see [https://github.com/inshore/bookwhen/blob/develop/CONTRIBUTING.md](https://github.com/inshore/bookwhen/blob/develop/CONTRIBUTING.md) for details.\n\n## Support\n\nIf you require assistance with this package or implementing in your own project or business...\n\n[https://bookwhen.com/inshore](https://bookwhen.com/inshore)\n\n\u003cscript type=\"text/javascript\" src=\"https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js\" data-name=\"bmc-button\" data-slug=\"danielmullin\" data-color=\"#FFDD00\" data-emoji=\"\" data-font=\"Cookie\" data-text=\"Buy me a coffee\" data-outline-color=\"#000000\" data-font-color=\"#000000\" data-coffee-color=\"#ffffff\" \u003e\u003c/script\u003e\n\n[https://www.buymeacoffee.com/danielmullin](https://www.buymeacoffee.com/danielmullin)\n\n## Credits\n\n- Daniel Mullin inshore@danielmullin.com\n- Brandon Lubbehusen inshore@danielmullin.com\n\nThis package was heavily influenced by Nuno Maduro and the https://github.com/openai-php/client package.\n\n## License\n\nMIT\nhttps://github.com/inshore/bookwhen/blob/master/LICENSE.md\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finshore%2Fbookwhen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finshore%2Fbookwhen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finshore%2Fbookwhen/lists"}