Download the PHP package bagooon/chatease-php-client without Composer
On this page you can find all versions of the php package bagooon/chatease-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bagooon/chatease-php-client
More information about bagooon/chatease-php-client
Files in bagooon/chatease-php-client
Package chatease-php-client
Short Description PHP client for ChatEase board API (server-side only)
License MIT
Informations about the package chatease-php-client
bagooon/chatease-php-client
PHP 用の ChatEase チャットボード API クライアント です。
サーバーサイド(PHP)専用で、ブラウザからの直接利用は想定していません。
Requirements
- PHP 8.1+
ext-jsonext-curl- ChatEase のワークスペース & API トークン
Installation
Quick Start
API
new ChatEaseClient(string $apiToken, string $workspaceSlug, ?string $baseUrl = null)
$apiToken– ChatEase の API トークン$workspaceSlug– ワークスペースの slug$baseUrl– ステージングなどを使う場合に差し替え。通常は省略可(https://chatease.jp)
createBoard(array $params): array
戻り値:
createBoardWithStatus(array $params): array
createBoard のパラメータに initialStatus を追加:
statusKey は以下のいずれか:
scheduled_for_proof- 校正予定scheduled_for_response- 返答予定scheduled_for_completion- 完了予定waiting_for_reply- 返答待ち
scheduled_for_* の場合は timeLimit が必須です(YYYY-MM-DD & 実在日付)。
waiting_for_reply の場合は timeLimit は不要です。
guestPassphrase は任意です。指定時はゲスト画面表示時に毎回確認され、全角換算 10 文字以内で指定します。
createBoardWithStatusAndMessage(array $params): array
さらに initialGuestComment を追加:
getWorkspaceName(): string
ワークスペースの表示名を取得します。
APIトークン+ワークスペーススラッグが正しく設定されているかを確認する用途に利用できます。
戻り値: ワークスペース名
例外:
RuntimeException- 401(APIトークンまたはWorkspace Slugが不正)
- HTTP ステータス異常
- JSON デコードエラー
- レスポンス形式不正
Raw Request Example
クライアントを使わずに直接 POST /api/v1/board を呼ぶ場合の例です。
guestPassphraseは任意です- 指定時はゲスト画面表示時に毎回確認されます
guestPassphraseは全角換算 10 文字以内です
Validation
このクライアントは、API 呼び出し前に以下の実行時チェックを行います:
guest.email- PHP の
filter_var($email, FILTER_VALIDATE_EMAIL)による簡易チェック
- PHP の
boardUniqueKey- 空文字禁止
- 前後空白禁止
- 空白文字(スペース・タブ・改行など)を含まない
- 最大 255 文字
guestPassphrase- 文字列のみ
- 前後空白は trim される前提
- 全角換算 10 文字以内
initialStatusstatusKeyがscheduled_for_*の場合はtimeLimit必須timeLimitはYYYY-MM-DD形式 &checkdateによる実在日付チェック
バリデーションエラーの場合は InvalidArgumentException が投げられます。
HTTP エラーや JSON デコードエラーなどは RuntimeException が投げられます。
Development
License
MIT
All versions of chatease-php-client with dependencies
ext-json Version *
ext-curl Version *