MessageHub 統合: Webhook でサポートされているイベント
公開日: 更新日:
この記事では、Webhook 経由で転送できるサポートされているイベントについて説明します。Webhook は、すべてのアカウントに対して定義できる HTTP コールバックです。これらは、MessageHub でのメッセージ作成などのイベントによってトリガーされます。複数の Webhook を MessageHub アカウントに接続できます。
-
アクティブなClickFunnelsアカウント
-
MessageHubアプリ
オブジェクト
Section titled “オブジェクト”イベントには、ペイロードとして次のいずれかのオブジェクトを含めることができます。MessageHub でサポートされているさまざまなタイプのオブジェクトは次のとおりです。
account
Section titled “account”アカウントに対して次のペイロードが返されます。
{ "id": "integer", "name": "string"}次のペイロードが受信トレイに返されます。
{ "id": "integer", "name": "string"}contact
Section titled “contact”連絡先に対して次のペイロードが返されます。
{ "id": "integer", "name": "string", "avatar": "string", "type": "contact", "account": { // <...account Object Attributes> }}次のペイロードがエージェント/管理者に対して返されます。
{ "id": "integer", "name": "string", "email": "string", "type": "user"}conversation
Section titled “conversation”会話に対して次のペイロードが返されます。
{ "additional_attributes": { "browser": { "device_name": "string", "browser_name": "string", "platform_name": "string", "browser_version": "string", "platform_version": "string" }, "referer": "string", "initiated_at": { "timestamp": "iso-datetime" } }, "can_reply": "boolean", "channel": "string", "id": "integer", "inbox_id": "integer", "contact_inbox": { "id": "integer", "contact_id": "integer", "inbox_id": "integer", "source_id": "string", "created_at": "datetime", "updated_at": "datetime", "hmac_verified": "boolean" }, "messages": [ // Array Of message Objects ], "meta": { "sender": { // contact Object Attributes }, "assignee": { // user Object Attributes } }, "status": "string", "unread_count": "integer", "agent_last_seen_at": "unix-timestamp", "contact_last_seen_at": "unix-timestamp", "timestamp": "unix-timestamp", "account_id": "integer"}message
Section titled “message”メッセージに対して次のペイロードが返されます。
{ "id": "integer", "content": "string", "message_type": "integer", "created_at": "unix-timestamp", "private": "boolean", "source_id": "string / null", "content_type": "string", "content_attributes": "object", "sender": { "type": "string - contact/user" // user Or contact Object Attributes }, "account": { // account Object Attributes }, "conversation": { // conversation Object Attributes }, "inbox": { // inbox Object Attributes }}Webhook ペイロードの例
Section titled “Webhook ペイロードの例”次に、返される最終的な Webhook ペイロードの例を示します。
{ "event": "event_name" // Attributes related to the event}MessageHub は、次の Webhook イベントをサポートしています。ダッシュボードで Webhook を設定したり、API を使用してサブスクライブしたりできます。
conversation_created
Section titled “conversation_created”このイベントは、アカウントで新しい会話が作成されるとトリガーされます。イベントのペイロードは次のとおりです。
{ "event": "conversation_created" // <...conversation Object Attributes>}conversation_updated
Section titled “conversation_updated”このイベントは、会話のいずれかの属性に変更があったときにトリガーされます。
{ "event": "conversation_updated" , "changed_attributes": [ { "<attribute_name>": { "current_value": "", "previous_value": "" } } ] // <...conversation Object Attributes>}conversation_status_changed
Section titled “conversation_status_changed”このイベントは、会話の状態が変更されたときにトリガーされます。
{ "event": "conversation_status_changed" // <...conversation Object Attributes>}message_created
Section titled “message_created”このイベントは、会話でメッセージが作成されるとトリガーされます。イベントのペイロードは次のとおりです。
{ "event": "message_created" // <...message Object Attributes>}message_updated
Section titled “message_updated”このイベントは、会話でメッセージが更新されたときにトリガーされます。イベントのペイロードは次のとおりです。
{ "event": "message_updated" // <...message Object Attributes>}webwidget_triggered
Section titled “webwidget_triggered”このイベントは、エンドユーザーがライブチャットウィジェットを開いたときにトリガーされます。
{ "id": "integer", "contact": { // <...contact Object Attributes> }, "inbox": { // <...inbox Object Attributes> }, "account": { // <...account Object Attributes> }, "current_conversation": { // <...conversation Object Attributes> }, "source_id": "string", "event": "webwidget_triggered", "event_info": { "initiated_at": { "timestamp": "date-string" }, "referer": "string", "widget_language": "string", "browser_language": "string", "browser": { "browser_name": "string", "browser_version": "string", "device_name": "string", "platform_name": "string", "platform_version": "string" } }}