API によるセッション中の認証

このページでは、SDK チャンネルでセッション中の認証に電話とチャットの API エンドポイントを使用する方法について説明します。

ユーザーは、認証なしでサポート セッション(サポート チャットなど)を開始できます。エンドユーザー認証が必要になったら、認証フローを開始できます。認証が成功したら、end_user 識別子を更新して、セッションを検証済みのエンドユーザーにリンクできます。

URI と認証

この新しいエンドポイントのベース URI は、comm_type によって異なります。

call comm_type の場合:

POST https://<subdomain>.<domain>//apps/api/v1/calls/:call_id/end_user

chat comm_type の場合:

POST https://<subdomain>.<domain>//apps/api/v1/chats/:chat_id/end_user

API オペレーション

パラメータ

API リクエストの本文には、次のフィールドが必要です。

ID フィールド名 種類 必須か? 説明 値の例
0 identifier String(文字列) 一意の外部識別子が指定されています。
1 name 文字列 × インタラクションに関連付けられた一般的な名前または識別子。お客様の検索に役立ちます。 John Doe
2 email 文字列 × インタラクションに関連付けられた一般的なメールアドレス。お客様の検索に役立ちます。 john@doe.com
3 phone String(文字列) × インタラクションに関連付けられている一般的な電話番号。お客様の検索に役立ちます。 123-456-7890

API サンプル

API レスポンスのサンプル

成功レスポンスの例:

202 Accepted

{
 "message": "accepted"
}

失敗レスポンスのサンプル

パラメータが指定されていない
400 {"message": "param is missing or the value is empty: comm_type"}
400 {"message": "param is missing or the value is empty: identifier"}
通話またはチャット以外のコミュニケーション タイプを参照している
404 {"message": "Not Found"}
セッションがアクティブでない
400 {"message": "Call is already ended"}
400 {"message": "Chat is already ended"}
サポートされていない CRM リクエスト
400 {"message": "Unsupported CRM request"}
リクエストの重複
400 {"message": "Duplicate request: Please wait for the interval to expire"}

API リクエストのサンプル

Call Comm Type

POST https://<subdomain>.<domain>/apps/api/v1/calls/:call_id/end_user
Content-Type: application/json
Authorization: Bearer <your_access_token>

{
    "identifier": "unique_external_id",
    "name": "John Doe",
    "email": "johndoe@example.com",
    "phone": "123-456-7890"
}

Chat Comm Type

POST https://<subdomain>.<domain>/apps/api/v1/chats/:chat_id/end_user
Content-Type: application/json
Authorization: Bearer <your_access_token>

{
    "identifier": "unique_external_id",
    "name": "Jane Smith",
    "email": "janesmith@example.com",
    "phone": "098-765-4321"
}

Apps API ドキュメント

その他の Apps API エンドポイントについては、Apps API の公開をご覧ください。