承接 crisphive/crisphive-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crisphive/crisphive-php

Composer 安装命令:

composer require crisphive/crisphive-php

包简介

Official PHP SDK for the CrispHive API.

README 文档

README

The official PHP SDK for the CrispHive API.

Typed access to the public /v1 API — customers, bookings, catalog, team and fleet.

Requirements

PHP 7.4+ with the curl, json and mbstring extensions.

Installation

composer require crisphive/crisphive-php

Authentication

Every request is authenticated with a secret API key sent as a bearer token. Create keys from your CrispHive business dashboard. The key prefix selects the data environment:

  • chsk_live_… → live (production) data
  • chsk_test_… → sandbox (isolated test) data

Load keys from the environment — never commit them.

Usage

<?php
require_once __DIR__ . '/vendor/autoload.php';

$config = Crisphive\Configuration::getDefaultConfiguration()
    ->setAccessToken(getenv('CRISPHIVE_API_KEY')); // SDK adds the "Bearer " prefix

$customers = new Crisphive\Api\CustomerApi(new GuzzleHttp\Client(), $config);

// List customers.
$res = $customers->listCustomers(null, null, null, null, null, 1, 20);
foreach ($res->getData()->getCustomers() ?? [] as $c) {
    echo $c->getId() . ' ' . $c->getFullName() . "\n";
}

// Create a customer.
try {
    $body = new Crisphive\Model\CustomerCreateRequest([
        'full_name' => 'Ada Lovelace',
        'email'     => 'ada@example.com',
    ]);
    $created = $customers->createCustomer($body);
    echo 'created ' . $created->getData()->getCustomerId() . "\n";
} catch (Crisphive\ApiException $e) {
    echo 'error ' . $e->getCode() . ' ' . $e->getResponseBody() . "\n";
}

Method parameter lists follow the generated signatures — see the API reference for the exact arguments of each call.

Pagination

List methods accept $page / $limit and return a meta object (total, count, per_page, current_page, total_pages).

Idempotency

create* calls (customers, bookings) accept an Idempotency-Key so retries never create a duplicate.

Errors

Non-2xx responses throw Crisphive\ApiException; inspect $e->getCode() and $e->getResponseBody() for the CrispHive error code.

Documentation

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: unlicense
  • 更新时间: 2026-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固