slotify/php-sdk
Composer 安装命令:
composer require slotify/php-sdk
包简介
PHP SDK for Slotify API
README 文档
README
The Slotify SDK is a PHP-based API client designed to simplify interactions with the Slotify scheduling app API. It provides a flexible and easy-to-use interface for making HTTP requests, managing configurations, and handling API responses, tailored specifically for Slotify's scheduling features.
Dependencies
This SDK uses the following library for HTTP requests:
- Guzzle - A PHP HTTP client that makes it easy to send HTTP requests and integrate with web services.
Features
- Configurable Base URL and API Key: Easily set the base URL and API key.
- CRUD Operations: Perform Create, Read, Update, and Delete operations on Slotify resources like bookings.
- Method Chaining: Chain methods for building complex queries with ease.
- Include Related Data: Fetch related data (e.g., customers, events) with a single request.
- Built-in Guzzle Integration: Powered by Guzzle for handling HTTP requests.
Installation
Install the library via Composer:
composer require slotify/sdk
Initialization
To use the SDK, initialize it with your API key and the Slotify base URL. Using api key, you can access app level data only. You can not use same key for multiple apps.
use SlotifySDK\ApiService;
$slotifyApi = new ApiService([
'apiKey' => '8c99a81c-dcbb-4de3-b316-f43b8a902cae',
]);
Usage (endpoints)
Documentation : https://slotify.ca/api
Endpoints/methods:
// App Endpoints
$slotifyApi->getApps();
// Customer Endpoints
$slotifyApi->getCustomers();
$slotifyApi->getCustomer('uuid');
$slotifyApi->createCustomer(['name' => 'John Doe']);
$slotifyApi->deleteCustomer('uuid');
$slotifyApi->updateCustomer('uuid', ['name' => 'Updated Name']);
// Group Endpoints
$slotifyApi->getGroups();
$slotifyApi->getGroup('uuid');
$slotifyApi->createGroup(['name' => 'Group Name']);
$slotifyApi->deleteGroup('uuid');
$slotifyApi->updateGroup('uuid', ['name' => 'Updated Group Name']);
// Resource Endpoints
$slotifyApi->getResources();
$slotifyApi->getResource('uuid');
$slotifyApi->createResource(['name' => 'Resource Name']);
$slotifyApi->deleteResource('uuid');
$slotifyApi->updateResource('uuid', ['name' => 'Updated Resource Name']);
// Scheduler Endpoints
$slotifyApi->getSchedulers();
$slotifyApi->getScheduler('uuid');
$slotifyApi->createScheduler(['title' => 'Scheduler Title']);
$slotifyApi->deleteScheduler('uuid');
$slotifyApi->updateScheduler('uuid', ['title' => 'Updated Scheduler Title']);
// Booking Endpoints
$slotifyApi->getBookings();
$slotifyApi->getBooking('uuid');
$slotifyApi->deleteBooking('uuid');
$slotifyApi->updateBooking('uuid', ['status' => 'confirmed']);
$slotifyApi->createBooking(['customer_id' => 'customer_uuid']);
// Booking Actions
$slotifyApi->completeBooking('uuid');
$slotifyApi->confirmBooking('uuid', [
'resource_id' => 'resource_uuid',
'customer_id' => 'customer_uuid'
]);
$slotifyApi->cancelBookingByCustomer('uuid', [
'customer_id' => 'customer_uuid',
'cancellation_message' => 'I am unable to attend'
]);
$slotifyApi->cancelBookingByResource('uuid', [
'resource_id' => 'resource_uuid',
'cancellation_message' => 'Resource unavailable'
]);
$slotifyApi->declineBooking('uuid', [
'resource_id' => 'resource_uuid',
'decline_message' => 'Service not available at this time'
]);
$slotifyApi->bookCustomer([
'customer' => [
'seats' => 10,
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'customer_notes' => 'Please arrive early'
]
]);
$slotifyApi->reassignBooking('uuid', [
'resources' => [
[
'old_resource_id' => 'old_resource_uuid',
'new_resource_id' => 'new_resource_uuid'
]
]
]);
$slotifyApi->rescheduleBookingByCustomer('uuid', [
'start' => '2024-11-06T09:00:00-05:00',
'end' => '2024-11-06T10:00:00-05:00',
'customer_id' => 'customer_uuid'
]);
// Event Endpoints
$slotifyApi->getEvents();
$slotifyApi->getEvent('uuid');
$slotifyApi->createEvent(['title' => 'Event Title']);
$slotifyApi->deleteEvent('uuid');
$slotifyApi->updateEvent('uuid', ['title' => 'Updated Event Title']);
// Service Endpoints
$slotifyApi->getServices();
$slotifyApi->getService('uuid');
$slotifyApi->createService(['name' => 'Service Name']);
$slotifyApi->deleteService('uuid');
$slotifyApi->updateService('uuid', ['name' => 'Updated Service Name']);
// Workflow Endpoints
$slotifyApi->getWorkflows();
$slotifyApi->getWorkflow('uuid');
$slotifyApi->createWorkflow(['name' => 'Workflow Name']);
$slotifyApi->deleteWorkflow('uuid');
$slotifyApi->updateWorkflow('uuid', ['name' => 'Updated Workflow Name']);
// Availability Endpoints
$slotifyApi->getAvailability(['date' => '2024-01-01']);
$slotifyApi->getUnAvailability(['date' => '2024-01-01']);
$slotifyApi->getAvailabilityCount(['date' => '2024-01-01']);
Usage (Dynamic Includes)
The Slotify SDK supports dynamic includes, allowing you to fetch related data in a single request.
Example:
$slotifyApi->include('customers', 'resources')
->getBookings();
Usage (Query Params)
If you want to use query params you can use it as below example. Check doc for more advance usage for search parameters.
Example:
$slotifyApi->queryParams([
'limit' => 10,
'search' => 'name~:john',
])->getCustomers();
slotify/php-sdk 适用场景与选型建议
slotify/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「calendar」 「sdk」 「scheduling」 「booking」 「availability」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 slotify/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 slotify/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 slotify/php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A modern PHP library for generating iCalendar v2.0 events
A powerful event calendar Tool for Laravel's Nova 5.
Check for holidays - localeaware
A PSR-7 compatible library for making CRUD API endpoints
This TYPO3 distribution provides a sample website using bootstrap and the extensions pizpalue and container_elements. The distribution tailors Swiss market featuring German as default language and additional translations to French, English and Finnish.
Shim repository for FullCalendar
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-05