定制 xalantis/sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xalantis/sdk

最新稳定版本:v0.1.0

Composer 安装命令:

composer require xalantis/sdk

包简介

Official PHP SDK for the Xalantis API

README 文档

README

Official PHP SDK for the Xalantis API.

Installation

composer require xalantis/sdk

Quick Start

use Xalantis\Xalantis;

$client = new Xalantis('sk_live_...');

Tickets

Create a ticket

$response = $client->tickets()->create([
    'subject' => 'Login issue',
    'description' => 'Cannot login since the latest update',
    'requester_email' => 'user@example.com',
    'priority' => 'high',
    'category_slug' => 'technical-support', // optional
]);

echo $response['data']['uuid'];
echo $response['data']['reference'];

List tickets

$response = $client->tickets()->list([
    'status' => 'open',
    'priority' => 'high',
    'per_page' => 10,
    'sort_by' => 'created_at',
    'sort_dir' => 'desc',
]);

echo $response['meta']['total'] . ' tickets found';

Get a ticket

$response = $client->tickets()->get('ticket-uuid');
$ticket = $response['data'];

Update a ticket

$client->tickets()->update('ticket-uuid', [
    'status' => 'resolved',
    'priority' => 'low',
]);

Reply to a ticket

$client->tickets()->reply('ticket-uuid', [
    'content' => 'This has been fixed in v2.1.0',
]);

// Internal note (not visible to requester)
$client->tickets()->reply('ticket-uuid', [
    'content' => 'Deployed hotfix to production',
    'is_internal' => true,
]);

List replies

$response = $client->tickets()->listReplies('ticket-uuid');

Error Handling

use Xalantis\Xalantis;
use Xalantis\Exceptions\XalantisException;

try {
    $client->tickets()->create([...]);
} catch (XalantisException $e) {
    echo $e->errorCode;  // 'VALIDATION_ERROR'
    echo $e->getMessage(); // 'Validation failed.'
    echo $e->status;      // 422
    print_r($e->details); // ['subject' => ['Required']]

    // Rate limiting
    if ($e->status === 429) {
        sleep($e->retryAfter ?? 60);
    }
}

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固