PHP code example of bagooon / chatease-php-client

1. Go to this page and download the library: Download bagooon/chatease-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bagooon / chatease-php-client example snippets




use Bagooon\ChatEase\ChatEaseClient;

 getenv('CHATEASE_API_TOKEN'),
    workspaceSlug: 'your-workspace-slug'
);

// 1) チャットボードのみ生成
$res1 = $client->createBoard([
    'title' => 'お問い合わせ #1001',
    'guest' => [
        'name'  => '田中太郎',
        'email' => '[email protected]',
    ],
    'guestPassphrase' => 'あいことば',
    'memo' => 'メモを登録できます',
    'boardUniqueKey' => '20260225-1001',
]);

// 2) 初期ステータス付きで生成
$res2 = $client->createBoardWithStatus([
    'title' => '見積依頼 #1002',
    'guest' => [
        'name'  => '鈴木花子',
        'email' => '[email protected]',
    ],
    'boardUniqueKey' => '20260225-1002',
    'initialStatus' => [
        'statusKey' => 'scheduled_for_response',
        'timeLimit' => '2026-02-28', // YYYY-MM-DD
    ],
]);

// 3) 初期ステータス + 初期投稿付きで生成
$res3 = $client->createBoardWithStatusAndMessage([
    'title' => 'デザイン相談 #1003',
    'guest' => [
        'name'  => 'John Smith',
        'email' => '[email protected]',
    ],
    'boardUniqueKey' => '20260225-1003',
    'initialStatus' => [
        'statusKey' => 'scheduled_for_proof',
        'timeLimit' => '2026-03-05',
    ],
    'initialGuestComment' => [
        'content' => 'ロゴデザインについて相談したいです。',
    ],
]);

// 4) ワークスペース名を取得する
$name = $client->getWorkspaceName();


[
  'title' => string,
  'guest' => [
    'name'  => string,
    'email' => string,
  ],
  'boardUniqueKey' => string,
  'guestPassphrase' => string|null, // optional
  'memo'           => string|null, // optional
  'inReplyTo'      => string|null, // optional
]

[
  'slug'     => string,
  'hostURL'  => string,
  'guestURL' => string,
]

'initialStatus' => [
  'statusKey' => string,       // 下記参照
  'timeLimit' => string|null,  // YYYY-MM-DD
],

'initialGuestComment' => [
  'content' => string,
],
bash
composer