カスタムイベントの追加

カスタムイベントは会話にメタデータを追加するために使用できます。カスタムイベントの使用にはいくつかの制限があります:

  • イベントタイプは custom:
  • イベントタイプは100文字以内
  • イベントタイプは英数字のみ、 - そして _ 文字
  • イベント本体は4096バイトを超えてはならない

以下の変数が、便利な方法で必要な値に設定されていることを確認してください:

キー説明
CONVERSATION_ID

The ID of the Conversation.

MEMBER_ID

The unique ID of the Member.

Prerequisites

You will need to use an existing Application that contains a Conversation in order to be able to add a custom event. See the Create Conversation code snippet for information on how to create an Application and some sample Conversations.

Write the code

Add the following to create-custom-event.sh:

View full source

Run your code

Save this file to your machine and run it:

sh create-custom-event.sh

試してみる

コードを実行すると、カスタム・イベントがあなたの イベントリスト