会話の作成

開発者は API を使用して会話を作成し、その後 Conversation ID を使用して顧客にメッセージを送信できます。

リクエストメソッド

POST

リクエスト URL

https://livedesk-api.engagelab.com/api/v2/accounts/conversations

認証

詳細は、API の概要 の認証手順を参照してください。

リクエスト

リクエスト例

curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/conversations \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic base64(api_key:api_secret)' \ -d '{ "inbox_id": 407, "contact_id": 2219256, "source_id": "123456789" }'
              
              curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/conversations \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Basic base64(api_key:api_secret)' \
  -d '{
    "inbox_id": 407,
    "contact_id": 2219256,
    "source_id": "123456789"
  }'

            
このコードブロックはフローティングウィンドウ内に表示されます

inbox_id は必須です。contact_id または source_id のいずれかを指定できますが、送信者を正しく識別するために、少なくともいずれか一方を指定する必要があります。

リクエストヘッダーパラメータ

Field Type Description
Authorization string Authorization: Basic base64(API Key:API Secret) を使用して認証します。API Keys ページで API Key と API Secret を取得し、コロンで連結したうえで、その結果を Base64 でエンコードしてください。
Content-Type application/json データ形式。通常のテキストメッセージには application/json を使用します。

リクエストボディパラメータ

Field Type Required Description
inbox_id String Yes チャネル ID。Create Contact API で使用する ID と一致します。
contact_id String No 連絡先 ID。Create Contact API によって返される ID です。
source_id String No ソース ID。

レスポンス

レスポンス例

{ "meta": { "sender": { "additional_attributes": {}, "availability_status": "offline", "email": null, "id": 2219256, "name": "wjTest", "phone_number": null, "blocked": false, "identifier": null, "thumbnail": "", "custom_attributes": {}, "created_at": 1766571624 }, "channel": "Channel::Api", "hmac_verified": false }, "id": 40, "messages": [], "account_id": 17623000010928, "uuid": "660ce36f-46bb-4153-948c-8a26e6dab634", "inbox_id": 407, "additional_attributes": {}, "agent_last_seen_at": 0, "assignee_last_seen_at": 0, "can_reply": true, "contact_last_seen_at": 0, "custom_attributes": {}, "labels": [], "muted": false, "snoozed_until": null, "status": "open", "priority": null, "conversation_category": "chat", "chat_mode": "private_chat", "is_forum": false, "created_at": 1766572062, "updated_at": 1766572062.5803902, "timestamp": 1766572062, "first_reply_created_at": 0, "unread_count": 0, "last_non_activity_message": null, "last_activity_at": 1766572062, "waiting_since": 1766572062, "sla_policy_id": null, "ticket_id": null, "over_limit": false, "content_preview": { "content": null, "message_type": null, "created_at": null }, "platform": { "channel_type": "Channel::Api", "inbox_name": "JennyApi", "inbox_id": 407 }, "account_info": { "contact_name": "wjTest", "contact_email": null, "contact_phone": null, "contact_id": 2219256, "contact_avatar": "" }, "assignment": { "assignee_id": null, "assignee_name": null, "assignee_email": null, "team_id": null, "team_name": null } }
              
              {
    "meta": {
        "sender": {
            "additional_attributes": {},
            "availability_status": "offline",
            "email": null,
            "id": 2219256,
            "name": "wjTest",
            "phone_number": null,
            "blocked": false,
            "identifier": null,
            "thumbnail": "",
            "custom_attributes": {},
            "created_at": 1766571624
        },
        "channel": "Channel::Api",
        "hmac_verified": false
    },
    "id": 40,
    "messages": [],
    "account_id": 17623000010928,
    "uuid": "660ce36f-46bb-4153-948c-8a26e6dab634",
    "inbox_id": 407,
    "additional_attributes": {},
    "agent_last_seen_at": 0,
    "assignee_last_seen_at": 0,
    "can_reply": true,
    "contact_last_seen_at": 0,
    "custom_attributes": {},
    "labels": [],
    "muted": false,
    "snoozed_until": null,
    "status": "open",
    "priority": null,
    "conversation_category": "chat",
    "chat_mode": "private_chat",
    "is_forum": false,
    "created_at": 1766572062,
    "updated_at": 1766572062.5803902,
    "timestamp": 1766572062,
    "first_reply_created_at": 0,
    "unread_count": 0,
    "last_non_activity_message": null,
    "last_activity_at": 1766572062,
    "waiting_since": 1766572062,
    "sla_policy_id": null,
    "ticket_id": null,
    "over_limit": false,
    "content_preview": {
        "content": null,
        "message_type": null,
        "created_at": null
    },
    "platform": {
        "channel_type": "Channel::Api",
        "inbox_name": "JennyApi",
        "inbox_id": 407
    },
    "account_info": {
        "contact_name": "wjTest",
        "contact_email": null,
        "contact_phone": null,
        "contact_id": 2219256,
        "contact_avatar": ""
    },
    "assignment": {
        "assignee_id": null,
        "assignee_name": null,
        "assignee_email": null,
        "team_id": null,
        "team_name": null
    }
}

            
このコードブロックはフローティングウィンドウ内に表示されます

レスポンスパラメータ

Field Type Required Description
meta Object No メタデータオブジェクト。
meta.sender Object No 送信者情報。
meta.sender.additional_attributes Object No 追加属性。
meta.sender.availability_status String No 稼働状況。
meta.sender.email Null No メールアドレス。
meta.sender.id Number No 連絡先 ID。
meta.sender.name String No 送信者名。
meta.sender.phone_number Null No 電話番号。
meta.sender.blocked Boolean No 送信者がブロックされているかどうか。
meta.sender.identifier Null No ユーザー属性識別子。
meta.sender.thumbnail String No サムネイル。
meta.sender.custom_attributes Object No カスタム属性。
meta.sender.created_at Number No 会話作成時のタイムスタンプ。
meta.channel String No チャネルタイプ。
meta.hmac_verified Boolean No HMAC 検証ステータス。
id Number No 会話 ID。
messages Array No メッセージ配列。
account_id Number No プロジェクト ID。
uuid String No 一意の識別子。
inbox_id Number No チャネル ID。
additional_attributes Object No 追加属性。
agent_last_seen_at Number No エージェントが最後に会話を処理した時刻。
assignee_last_seen_at Number No 担当者が最後に会話を処理した時刻。
can_reply Boolean No 返信できるかどうか。
contact_last_seen_at Number No 連絡先の最終確認時刻。
custom_attributes Object No カスタム属性。
labels Array No ラベル配列。
muted Boolean No 会話がミュートされているかどうか。
snoozed_until Null No 会話のスヌーズ解除時刻。
status String No ステータス。
priority Null No 優先度。
conversation_category String No 会話カテゴリ。
chat_mode String No チャットモード。
is_forum Boolean No 会話がフォーラムかどうか。
created_at Number No 作成時のタイムスタンプ。
updated_at Number No 更新時のタイムスタンプ。
timestamp Number No タイムスタンプ。
first_reply_created_at Number No 最初の返信が作成された時刻。
unread_count Number No 未読件数。
last_non_activity_message Null No 最後の非アクティビティメッセージ。
last_activity_at Number No 最終アクティビティ時刻。
waiting_since Number No 待機開始時刻。
sla_policy_id Null No SLA ポリシー ID。
ticket_id Null No チケット ID。
over_limit Boolean No 上限を超えているかどうか。
content_preview Object No コンテンツプレビュー。
content_preview.content Null No プレビューコンテンツ。
content_preview.message_type Null No メッセージタイプ。
content_preview.created_at Null No 作成時刻。
platform Object No プラットフォーム情報。
platform.channel_type String No チャネルタイプ。
platform.inbox_name String No Inbox 名。
platform.inbox_id Number No Inbox ID。
account_info Object No アカウント情報。
account_info.contact_name String No 連絡先名。
account_info.contact_email Null No 連絡先のメールアドレス。
account_info.contact_phone Null No 連絡先の電話番号。
account_info.contact_id Number No 連絡先 ID。
account_info.contact_avatar String No 連絡先アバター。
assignment Object No 割り当て情報。
assignment.assignee_id Null No 担当者 ID。
assignment.assignee_name Null No 担当者名。
assignment.assignee_email Null No 担当者のメールアドレス。
assignment.team_id Null No チーム ID。
assignment.team_name Null No チーム名。
Icon Solid Transparent White Qiyu
お問い合わせ