airlst/

sdk-php

该软件包的最新版本(0.0.2)没有可用的许可证信息。

此软件包是处理AirLST Core API调用的SDK。

0.0.2 2024-05-14 14:47 UTC

This package is auto-updated.

Last update: 2024-09-02 10:07:06 UTC


README

example workflow

PHP核心API SDK

需求

  • PHP 8.2
  • Composer

安装

需要安装此软件包。

composer require airlst/sdk-php

使用方法

首先,您需要设置API密钥

use AirLST\SdkPhp\CoreApi;

$core = new Core('api-key-here');

事件资源

目前只有2个可用的方法

列出所有公司事件

重要:此方法要求API密钥必须绑定到公司!

$response = $core->event()->list();

$response->json(); // Get response data as array

使用UUID获取事件详情

$response = $core->event()->get('event-uuid-here');

$response->json(); // Get response data as array

嘉宾资源

验证嘉宾代码

$response = $core->guest('event-uuid-here')->validateCode('guest-code');

$response->json(); // Get response data as array

使用代码获取嘉宾

$response = $core->guest('event-uuid-here')->get('guest-code');

$response->json(); // Get response data as array

创建嘉宾

$response = $core->guest('event-uuid-here')->create([
    'status' => 'confirmed',
    'contact' => [
        'first_name' => 'John',
        'last_name' => 'Doe'
    ]
]);

$response->json(); // Get response data as array

使用代码更新现有嘉宾

$response = $core->guest('event-uuid-here')->update('guest-code', [
    'status' => 'confirmed',
    'contact' => [
        'last_name' => 'Wick'
    ]
]);

$response->json(); // Get response data as array