Webhook使用説明
このドキュメントは、ユーザーが提供するWebhookインターフェースの入力パラメータと戻り値を規定します。
インターフェースには2つの使用方式があります。
+ メッセージトリガー型: ユーザーメッセージのマッチングによってトリガーされ、回答はWebhookで返されるansContentで置き換えられます。
+ タスクプッシュ型: これは、ロボット管理システムのタスク型対話機能についてある程度理解している必要があります。リクエストパラメータは当方があなたのインターフェースを呼び出す際に入力するパラメータであり、リクエスト結果は当方がインターフェースで指定された形式で返すことを必要とする情報です。
一、メッセージトリガー型
認証方式
計算式
sign=SHA1(integrationName&appKey×tamp)
各要素:
+ integrationName: 連携名称、Webhook設定で設定された名称
+ key: 認証キー、Webhookで設定されたkey
+ timestamp: タイムスタンプ、'1970-01-01 00:00:00'から現在までの秒数
+ データ間は&記号で連結します
認証データ例
| 名称 |
値 |
| integrationName |
連携一 |
| key |
221b368d7f5f597867f525971f28ff75 |
| timestamp |
1496631984 |
署名の計算:
sign = sha1("連携一&221b368d7f5f597867f525971f28ff75&1496631984") ->
96d8271cd705d3f134d215e9b3c27bb73f1132ed
リクエストアドレス
- POST HOST/{relative address}
リクエストパラメータ
リクエストボディ (Request Body)
| Path |
Type |
Required |
説明 |
| timestamp |
Integer |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| integrationName |
String |
true |
連携名称 |
| regex |
String |
true |
正規表現 |
| questionContent |
String |
true |
質問内容 |
| extra |
Object |
false |
追加パラメータオブジェクト |
| extra.weChatOpenId |
String |
false |
微信チャネルの場合、微信のopenId |
| customerExtra |
Object |
false |
カスタマー定義追加オブジェクト |
| customerExtra.customerId |
Integer |
false |
カスタマーサポートシステムのユーザーId |
リクエスト結果
| Path |
Type |
説明 |
| answerContent |
String |
回答内容 |
例
$ curl 'HOST/API' -i -X POST -H 'Content-Type: application/json' -d '{
"timestamp" : 1513150103,
"sign" : "ab991af4ef65fc6061cf16c19d7d9d1bc1e12dcb",
"integrationName" : "連携一",
"regex" : "[abc]",
"questionContent" : "問題内容",
"extra" : {
weChatOpenId : "wechatId"
}
}'
返信
{
"answerContent" : "ここに回答があります"
}
二、タスクプッシュ型
署名
- 内容(key + taskNodeId + sessionId + timestamp)
- 方式(md5Hex)
署名パラメータ(データ間は直接連結)
- key: 認証キー、webhookで設定されたkey
- taskNodeId: リクエストボディで渡される、現在のタスクツリーで到達したノードID(webhookが新フォームで使用される場合は認証に参加せずnull)
- sessionId: リクエストボディで渡される、現在のセッションの識別ID
- timestamp: リクエストボディで渡される、タイムスタンプ、'1970-01-01 00:00:00'からの秒数
認証データ例
| 名称 |
値 |
| taskNodeId |
100 |
| sessionId |
100 |
| key |
abcde |
| timestamp |
1551510709 |
署名計算:
public String generateSign(){
StringBuilder query = new StringBuilder();
query.append(key);
//taskNodeIdがnullでない場合は認証に参加
if (taskNodeId != null) {
query.append(taskNodeId);
}
query.append(sessionId).append(timestamp);
return DigestUtils.md5Hex(query.toString());
}
例
//タスクツリー内で使用する場合に生成される署名
sign = md5Hex(abcde1001001551510709) ->
9195e2a5c1d84b86dc59819f29a0e300
//新フォームで使用する場合に生成される署名
sign = md5Hex(abcde1001551510709) ->
7c3479422b034a62fff5d23e883f07d8
1.出力スタイル-完全カスタムスタイル
リクエストパラメータ
リクエストボディ
| パラメータ |
タイプ |
必須 |
説明 |
| taskNodeId |
Integer |
false |
ノードID,現在のタスク型セッションがマッチして停止しているノードID(タスクツリー内で使用する場合は必須、新フォームで使用する場合は空) |
| sessionId |
Integer |
true |
セッションID,対話記録のID |
| timestamp |
Long |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| variables |
Map |
false |
変数Map,タスクツリー設定で収集された変数 |
| customerExtra |
Object |
false |
カスタマーカスタム追加オブジェクト |
| customerExtra.customerId |
Integer |
false |
カスタマーサポートシステムのユーザーID |
| customerExtra.callerNumber |
String |
false |
音声ロボット発信者番号(このフィールドは音声ロボットで使用) |
| customerExtra.dialogueDesc |
String |
false |
このフィールドの使用は特殊で、ロボットとの対話Webhookにカスタム情報を渡す顧客のニーズを満たすためです。まずカスタマーサポートシステム内の顧客カスタムフィールドで、c_cf_dialogueDescという名前のカスタムフィールドを設定する必要があります。顧客のこのフィールド値を設定できます。その後、チャットプラグインを開き、このフィールドをパスパラメータに追加します。形式は以下の通りです。https://xxx.udesk.cn/im_client/?web_plugin_id=41597&c_cf_dialogueDesc=* このようにすると、システムは自動的にこのパラメータ値をdialogueDescというパラメータとしてwebhookのリクエストパラメータの一つに渡します。特別な注意:カスタマーサポートシステムとパスパラメータ渡しはどちらもc_cf_dialogueDescというパラメータ名で値を渡します。 |
| #### リクエスト結果 |
|
|
|
| Parameter |
Type |
Description |
|
| --- |
--- |
--- |
|
| resCode |
Integer |
レスポンスコード【0成功/-1失敗】 |
|
| resError |
String |
ユーザーレベル以外のエラーメッセージ |
|
| message |
Message |
ユーザーメッセージ |
|
| variables |
Map |
変数設定。変数表を変更できます |
|
| toTaskNodeId |
Integer |
ジャンプ先タスクノードID。アクションがノードジャンプの場合に有効 |
|
| routeType |
Integer |
ジャンプ先ノードタイプ(1.直接トリガー 2.返信待ち) |
|
| command |
String |
アクションコマンド |
|
message
| Parameter |
Type |
Required |
Description |
| msgType |
String |
true |
メッセージタイプ |
| msgContent |
Object |
true |
メッセージ内容 |
msg_type
selective_table
| Parameter |
Type |
Description |
| title |
String |
タイトル |
| rowNumber |
Integer |
行数 |
| columnNumber |
Integer |
列数 |
| optionList |
List<Option> |
オプションリスト |
selective_list
| Parameter |
Type |
Description |
| title |
String |
タイトル |
| optionList |
List<Option> |
オプションリスト |
show_product
| Parameter |
Type |
Description |
| title |
String |
タイトル |
| showSize |
Integer |
デフォルト表示数 |
| turnFlag |
Integer |
カルーセルフラグ |
| productList |
List<OptionalProduct> |
商品リスト |
custom_card
| Parameter |
Type |
Description |
| id |
Integer |
主キー |
| name |
String |
名称 |
| turnFlag |
Integer |
カルーセルフラグ 0否1是 デフォルト 0 「次のグループへ」機能 |
| showSize |
Integer |
カードリスト表示数 turnFlag=1の場合有効 |
| title |
String |
タイトル。空でない場合、タイトルカードを表示 |
| cardList |
List |
カードリスト |
| cardList[].id |
Integer |
カードID |
| cardList[].type |
Integer |
カードタイプ 1.リッチテキストカード 2.FAQ推奨リストカード |
| cardList[].isHit |
Integer |
カードがクリック可能かどうか type=1の場合有効 0否 1是 |
| cardList[].hitType |
Integer |
カードクリック時の効果 type=1&isHit=1の場合有効 1ハイパーリンク 2メッセージ返信 メッセージ返信とは、チャットウィンドウでユーザーに代わってテキストを質問することです 3構造化メッセージ。hitContentテキスト内容をメッセージとして送信 4 ミニアプリリンク |
| cardList[].hitContent |
String |
カードクリック時の内容 type=1&isHit=1の場合有効 hitType=1はリンクアドレス hitType=4はミニアプリジャンプリンク |
| cardList[].hitShowContent |
String |
hitType=3の場合有効 クリックしてメッセージを送信するメッセージカード。このフィールドが空でない場合、チャットウィンドウにこれを表示。空の場合はcontentを表示 |
| cardList[].content |
String |
リッチテキストの具体的な内容 type=1の場合有効 |
| cardList[].suggestContent |
String |
FAQ推奨カードの文案type=2の場合有効 |
| cardList[].suggestList |
List |
FAQ推奨の質問リストtype=2の場合有効 |
| cardList[].suggestList[].id |
Integer |
質問の識別ID.type=2の場合有効 |
| cardList[].suggestList[].content |
String |
質問の内容.type=2の場合有効 |
| cardList[].suggestList[].type |
Integer |
質問タイプtype=2の場合有効 |
| ##### optional_product |
|
|
| パラメータ |
型 |
説明 |
| --- |
--- |
--- |
| id |
Integer |
ID |
| name |
String |
商品名 |
| image |
String |
商品画像 |
| url |
String |
商品リンク |
| infoList |
List<ProductInfo> |
商品情報 |
product_info
| パラメータ |
型 |
説明 |
| info |
String |
テキスト |
| boldFlag |
String |
太字フラグ |
| url |
Integer |
商品リンク |
| color |
String |
色 |
option
| パラメータ |
型 |
説明 |
| id |
String |
オプションID |
| value |
String |
オプション値 |
例
## appKey:abcde
## sign:md5Hex(abcde1001001551510709)
$ curl 'http://demo.km.tryudesk.com/goods/full' -X POST -H 'Content-Type: application/json' -d '{
"taskNodeId" : 1,
"sessionId" : 1,
"timestamp" : 1551510709,
"variables" : {
"city":"北京",
"name":"李浩"
},
"sign" : "9195e2a5c1d84b86dc59819f29a0e300",
"pageSize":5,
"pageNum":1
}'
レスポンス
{
"resCode": 0,
"resError": null,
"message": {
"msgType": "custom_card",
"msgContent": {
"id": 1,
"name": null,
"turnFlag": null,
"showSize": null,
"pageType": 1,
"pageNum": 1,
"pageSize": 5,
"total": 10,
"title": "ご確認いただきたい注文を選択してください",
"subTitle": null,
"cardListType": 1,
"chooseType": null,
"multipleChooseShowContent": null,
"chooseTime": null,
"cardList": [
{
"id": "21",
"type": 1,
"isHit": 1,
"hitType": 3,
"hitContent": "HZ234102391923",
"content": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-4.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>日本Fancl芳珂温和清洁卸妆油无添加脸部眼唇无刺激120ml*2瓶</div>\n\t\t\t <div>好化妆品4</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥258.00元</div>\n <div>合計2点</div>\n <div>未発送</div>\n </div>\n </div>",
"hitShowContent": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-4.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>日本Fancl芳珂温和清洁卸妆油无添加脸部眼唇无刺激120ml*2瓶</div>\n\t\t\t <div>好化妆品4</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥258.00元</div>\n <div>合計2点</div>\n <div>未発送</div>\n </div>\n </div>",
"switchStaffInfo": {
"orderNo": "0.06657132716779857"
}
},
{
"id": "20",
"type": 1,
"isHit": 1,
"hitType": 3,
"hitContent": "HZ23434523566",
"content": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-3.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>Lancome兰蔻小黑瓶100ml全新第二代补水保湿修复面部精华液肌底</div>\n\t\t\t <div>好化妆品3</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥809.00元</div>\n <div>合計1点</div>\n <div>輸送中</div>\n </div>\n </div>",
"hitShowContent": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-3.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>Lancome兰蔻小黑瓶100ml全新第二代补水保湿修复面部精华液肌底</div>\n\t\t\t <div>好化妆品3</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥809.00元</div>\n <div>合計1点</div>\n <div>輸送中</div>\n </div>\n </div>",
"switchStaffInfo": {
"orderNo": "0.0775044823922405"
}
},
{
"id": "19",
"type": 1,
"isHit": 1,
"hitType": 3,
"hitContent": "HZ2334232456",
"content": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-2.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>Armani/阿玛尼唇釉红管哑光丝绒口红番茄色405/400/206/415/300</div>\n\t\t\t <div>好化妆品2</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥155.00元</div>\n <div>合計1点</div>\n <div>輸送中</div>\n </div>\n </div>",
"hitShowContent": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-2.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>Armani/阿玛尼唇釉红管哑光丝绒口红番茄色405/400/206/415/300</div>\n\t\t\t <div>好化妆品2</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥155.00元</div>\n <div>合計1点</div>\n <div>輸送中</div>\n </div>\n </div>",
"switchStaffInfo": {
"orderNo": "0.32059480118821715"
}
},
{
"id": "18",
"type": 1,
"isHit": 1,
"hitType": 3,
"hitContent": "HZ134133239923",
"content": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-1.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>YSL圣罗兰细管口红哑光复古红小金条21号色显白高阶胡萝卜28号色</div>\n\t\t\t <div>好化妆品1</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥335.00元</div>\n <div>合計1点</div>\n <div>完了</div>\n </div>\n </div>",
"hitShowContent": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/hzp-1.png\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>YSL圣罗兰细管口红哑光复古红小金条21号色显白高阶胡萝卜28号色</div>\n\t\t\t <div>好化妆品1</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥335.00元</div>\n <div>合計1点</div>\n <div>完了</div>\n </div>\n </div>",
"switchStaffInfo": {
"orderNo": "0.6124907173788937"
}
},
{
"id": "17",
"type": 1,
"isHit": 1,
"hitType": 3,
"hitContent": "AJ578203294820",
"content": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/xie-8.jpg\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>New Balance 703系列 嘿</div>\n\t\t\t <div>好鞋子8</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥350.00元</div>\n <div>合計10点</div>\n <div>完了</div>\n </div>\n </div>",
"hitShowContent": "<div style=\"display: flex; margin: 0 20px; padding: 10px 0; border-bottom: 1px solid #C9C9C9;\">\n <div style=\"position: relative; flex: 1;\">\n <img style=\"position: absolute; max-width: 100%; max-height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%);\" src=\"https://staging-udesk.oss-cn-beijing.aliyuncs.com/demo/product_card/xie-8.jpg\" alt=\"画像\">\n </div>\n <div style=\"flex: 3; margin: 0 10px;\">\n <div>New Balance 703系列 嘿</div>\n\t\t\t <div>好鞋子8</div>\n </div>\n <div style=\"flex: 1; text-align: center;\">\n <div>¥350.00元</div>\n <div>合計10点</div>\n <div>完了</div>\n </div>\n </div>",
"switchStaffInfo": {
"orderNo": "0.7458115443687116"
}
}
]
},
"showType": null,
"cardListType": null
},
"variables": null,
"toTaskNodeId": null,
"routeType": null,
"command": null
}
2.出力スタイル-システムプリセットスタイル
2.1.バブルリストおよび横スライドカード

リクエストパラメータ
リクエストボディ
| パラメータ |
型 |
必須 |
説明 |
| taskNodeId |
Integer |
true |
ノードID, 現在のタスク型セッションがマッチして滞留しているノードのId |
| sessionId |
Integer |
true |
セッションID, 対話記録のId |
| timestamp |
Long |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| variables |
Map |
false |
変数Map, タスクツリー設定で収集された変数 |
| pageNum |
Integer |
true |
ページ番号 |
| pageSize |
Integer |
true |
1ページあたりの表示件数 |
| customerExtra |
Object |
false |
カスタマーカスタム追加オブジェクト |
| customerExtra.customerId |
Integer |
false |
カスタマーサポートシステムのユーザーId |
| customerExtra.callerNumber |
String |
false |
音声ロボットの発信者番号(このフィールドは音声ロボットで使用) |
| customerExtra.dialogueDesc |
String |
false |
このフィールドの使用は特殊で、カスタマーがロボットとの対話のWebhookにカスタム情報を渡すニーズを満たすためです。まず、カスタマーサポートシステム内のカスタマーカスタムフィールドで、名前がc_cf_dialogueDescのカスタムフィールドを設定する必要があります。カスタマーのこのフィールド値を設定できます。その後、チャットプラグインを開き、このフィールドをパスパラメータに追加します。形式は以下の通りです:https://xxx.udesk.cn/im_client/?web_plugin_id=41597&c_cf_dialogueDesc=*******。これにより、システムは自動的にこのパラメータ値をdialogueDescパラメータとしてWebhookのリクエストパラメータの一つに渡します。特別な注意:カスタマーサポートシステムとパスパラメータの両方で、パラメータ名c_cf_dialogueDescを使用して値を渡します。 |
| ##### リクエスト結果 |
|
|
|
| パラメータ |
タイプ |
必須 |
説明 |
| code |
Integer |
true |
200は成功を表します |
| data |
Array |
はい |
商品情報 |
| data[].id |
Integer |
はい |
商品ID |
| data[].img |
String |
はい |
商品画像 |
| data[].title |
String |
はい |
商品タイトル |
| data[].subTitle |
String |
いいえ |
商品サブタイトル |
| data[].attr1 |
String |
いいえ |
属性1 |
| data[].attr2 |
String |
いいえ |
属性2 |
| data[].attr3 |
String |
いいえ |
属性3 |
| data[].hitContent |
String |
いいえ |
商品クリック時にボットに送信する内容 |
| data[].jumpUrl |
String |
いいえ |
商品クリック時のジャンプリンクURL |
| paging |
Object |
はい |
ページネーション |
| paging.pageNum |
Integer |
はい |
ページ数 |
| paging.pageSize |
Integer |
はい |
1ページあたりの数量 |
| paging.total |
Integer |
はい |
総数 |
例
## appKey:abcde
## sign:md5Hex(abcde1001001551510709)
$ curl 'http://demo.km.tryudesk.com/goods' -X POST -H 'Content-Type: application/json' -d '{
"taskNodeId" : 1,
"sessionId" : 1,
"timestamp" : 1551510709,
"sign" : "9195e2a5c1d84b86dc59819f29a0e300",
"pageSize":5,
"pageNum":1
}'
レスポンス
{
"code": 200,
"message": "OK",
"visible": false,
"paging": {
"pageNum": 1,
"pageSize": 5,
"total": 20
},
"data": [{
"id": 21,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-4.png",
"title": "日本Fancl芳珂温和清洁卸妆油无添加脸部眼唇无刺激120ml*2瓶",
"subTitle": "好化妆品4",
"attr1": "258.00",
"attr2": "2",
"attr3": "未发货",
"hitContent": "HZ234102391923",
"jumpUrl": "http://www.udesk.cn",
"tabId": null
}, {
"id": 20,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-3.png",
"title": "Lancome兰蔻小黑瓶100ml全新第二代补水保湿修复面部精华液肌底",
"subTitle": "好化妆品3",
"attr1": "809.00",
"attr2": "1",
"attr3": "运输中",
"hitContent": "HZ23434523566",
"jumpUrl": "http://www.udesk.cn",
"tabId": null
},{
"id": 19,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-2.png",
"title": "Armani/阿玛尼唇釉红管哑光丝绒口红番茄色405/400/206/415/300",
"subTitle": "好化妆品2",
"attr1": "155.00",
"attr2": "1",
"attr3": "运输中",
"hitContent": "HZ2334232456",
"jumpUrl": "http://www.udesk.cn",
"tabId": null
},
{
"id": 18,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-1.png",
"title": "YSL圣罗兰细管口红哑光复古红小金条21号色显白高阶胡萝卜28号色",
"subTitle": "好化妆品1",
"attr1": "335.00",
"attr2": "1",
"attr3": "已完成",
"hitContent": "HZ134133239923",
"jumpUrl": "http://www.udesk.cn",
"tabId": null
},
{
"id": 17,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-8.jpg",
"title": "New Balance 703系列 嘿",
"subTitle": "好鞋子8",
"attr1": "350.00",
"attr2": "10",
"attr3": "已完成",
"hitContent": "AJ578203294820",
"jumpUrl": "http://www.udesk.cn",
"tabId": null
}
]
}
2.2. ドロワーリスト(商品カテゴリーリスト)
最大5つのカテゴリー、商品総数は20個以内、ページングはサポートされていません
リクエストパラメータ
リクエストボディ
| パラメータ |
型 |
必須 |
説明 |
| taskNodeId |
Integer |
true |
ノードID、現在のタスク型セッションがマッチして滞在しているノードのId |
| sessionId |
Integer |
true |
セッションID、対話記録のId |
| timestamp |
Long |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| variables |
Map |
false |
変数Map、タスクツリー設定で収集された変数 |
| customerExtra |
Object |
false |
カスタマー定義追加オブジェクト |
| customerExtra.customerId |
Integer |
false |
カスタマーサポートシステムのユーザーId |
| customerExtra.callerNumber |
String |
false |
音声ロボット発信者番号(このフィールドは音声ロボットで使用) |
| customerExtra.dialogueDesc |
String |
false |
このフィールドの使用は特殊で、カスタマーがロボットとの対話Webhookにカスタム情報を渡すニーズを満たすためです。まず、カスタマーサポートシステム内のカスタマー定義フィールドで、名前がc_cf_dialogueDescのカスタムフィールドを設定する必要があります。カスタマーのこのフィールド値を設定できます。その後、チャットプラグインを開き、このフィールドをパスパラメータに追加します。形式は以下の通りです:https://xxx.udesk.cn/im_client/?web_plugin_id=41597&c_cf_dialogueDesc=*******。これにより、システムは自動的にこのパラメータ値をdialogueDescパラメータとしてWebhookのリクエストパラメータの一つに渡します。特別な注意:カスタマーサポートシステムとパスパラメータ渡しはどちらもc_cf_dialogueDescパラメータ名を使用して値を渡します。 |
| ##### リクエスト結果 |
|
|
|
| パラメータ |
タイプ |
必須 |
説明 |
| code |
Integer |
true |
200は成功を表す |
| data.title |
|
|
タイトル |
| data.tabList |
Array |
はい |
カテゴリ |
| data.tabList[].id |
String |
はい |
カテゴリID |
| data.tabList[].name |
String |
はい |
カテゴリ名 |
| data.tabDataList |
Array |
はい |
商品データ |
| data.tabDataList [].tabId |
String |
はい |
所属カテゴリ |
| data.tabDataList [].id |
Integer |
はい |
商品ID |
| data.tabDataList [].img |
String |
はい |
商品画像 |
| data.tabDataList [].title |
String |
はい |
商品タイトル |
| data.tabDataList [].subTitle |
String |
いいえ |
商品サブタイトル |
| data.tabDataList [].attr1 |
String |
いいえ |
属性1 |
| data.tabDataList [].attr2 |
String |
いいえ |
属性2 |
| data.tabDataList [].attr3 |
String |
いいえ |
属性3 |
| data.tabDataList [].hitContent |
String |
いいえ |
商品をクリックしてチャットボットに送信する内容 |
| paging |
Object |
はい |
ページング |
| paging.pageNum |
Integer |
はい |
ページ番号 |
| paging.pageSize |
Integer |
はい |
1ページあたりの数量 |
| paging.total |
Integer |
はい |
総数 |
| #### 例 |
|
|
|
## appKey:abcde
## sign:md5Hex(abcde1001001551510709)
$ curl 'http://demo.km.tryudesk.com/goods/category' -X POST -H 'Content-Type: application/json' -d '{
"taskNodeId" : 1,
"sessionId" : 1,
"timestamp" : 1551510709,
"sign" : "9195e2a5c1d84b86dc59819f29a0e300",
"pageSize":5,
"pageNum":1
}'
レスポンス
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"title": "必要な商品を選択してください",
"tabList": [
{
"id": "1",
"name": "カテゴリ1"
},
{
"id": "2",
"name": "カテゴリ2"
},
{
"id": "3",
"name": "カテゴリ3"
},
{
"id": "4",
"name": "カテゴリ4"
},
{
"id": "5",
"name": "カテゴリ5"
}
],
"tabDataList": [
{
"id": 21,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-4.png",
"title": "日本Fancl芳珂温和清洁卸妆油无添加脸部眼唇无刺激120ml*2瓶",
"subTitle": "良質化粧品4",
"attr1": "258.00",
"attr2": "2",
"attr3": "未発送",
"hitContent": "HZ234102391923",
"tabId": "1"
},
{
"id": 20,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-3.png",
"title": "Lancome兰蔻小黑瓶100ml全新第二代补水保湿修复面部精华液肌底",
"subTitle": "良質化粧品3",
"attr1": "809.00",
"attr2": "1",
"attr3": "輸送中",
"hitContent": "HZ23434523566",
"tabId": "1"
},
{
"id": 19,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-2.png",
"title": "Armani/阿玛尼唇釉红管哑光丝绒口红番茄色405/400/206/415/300",
"subTitle": "良質化粧品2",
"attr1": "155.00",
"attr2": "1",
"attr3": "輸送中",
"hitContent": "HZ2334232456",
"tabId": "1"
},
{
"id": 18,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/hzp-1.png",
"title": "YSL圣罗兰细管口红哑光复古红小金条21号色显白高阶胡萝卜28号色",
"subTitle": "良質化粧品1",
"attr1": "335.00",
"attr2": "1",
"attr3": "完了",
"hitContent": "HZ134133239923",
"tabId": "1"
},
{
"id": 17,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-8.jpg",
"title": "New Balance 703系列 嘿",
"subTitle": "良質靴8",
"attr1": "350.00",
"attr2": "10",
"attr3": "完了",
"hitContent": "AJ578203294820",
"tabId": "1"
},
{
"id": 16,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-7.jpg",
"title": "Nike Hyperdunk X 黑白",
"subTitle": "良質靴7",
"attr1": "349.00",
"attr2": "9",
"attr3": "完了",
"hitContent": "AJ234872023092",
"tabId": "2"
},
{
"id": 15,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-6.jpg",
"title": "Nike LeBron 18 EP 黑紫",
"subTitle": "良質靴6",
"attr1": "348.00",
"attr2": "8",
"attr3": "返金済み",
"hitContent": "AJ234102391923",
"tabId": "2"
},
{
"id": 14,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-5.jpg",
"title": "Adidas D Lillard 2 复活节 兰白高帮新款 特别推荐 阿迪名款 ",
"subTitle": "良質靴5",
"attr1": "347.00",
"attr2": "7",
"attr3": "未払い",
"hitContent": "AJ23434523566",
"tabId": "2"
},
{
"id": 13,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-4.jpg",
"title": "Air Jordan 1 Low Shadow 影子",
"subTitle": "良質靴4",
"attr1": "346.00",
"attr2": "6",
"attr3": "未発送",
"hitContent": "AJ2334232456",
"tabId": "2"
},
{
"id": 12,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-3.jpg",
"title": "Air Jordan 1 Mid “Chicago” 白红 小芝加哥",
"subTitle": "良質靴3",
"attr1": "345.00",
"attr2": "5",
"attr3": "発送済み",
"hitContent": "AJ234123239923",
"tabId": "2"
},
{
"id": 11,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-2.jpg",
"title": "【刘耀文同款】Vans Old Skool Black 黑白休闲板鞋",
"subTitle": "良質靴2",
"attr1": "344.00",
"attr2": "4",
"attr3": "配送中",
"hitContent": "AJ2341553222223",
"tabId": "3"
},
{
"id": 10,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/xie-1.jpg",
"title": "【薇娅推荐】 Converse All Star 70 高帮复古黑 1970s 2018款",
"subTitle": "良質靴1",
"attr1": "343.00",
"attr2": "3",
"attr3": "完了",
"hitContent": "AJ23412333456",
"tabId": "3"
},
{
"id": 9,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/8.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服8",
"attr1": "350.00",
"attr2": "10",
"attr3": "完了",
"hitContent": "AX578203294820",
"tabId": "3"
},
{
"id": 8,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/7.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服7",
"attr1": "349.00",
"attr2": "9",
"attr3": "完了",
"hitContent": "LD234872023092",
"tabId": "3"
},
{
"id": 7,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/6.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服6",
"attr1": "348.00",
"attr2": "8",
"attr3": "返金済み",
"hitContent": "WE234102391923",
"tabId": "3"
},
{
"id": 6,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/5.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服5",
"attr1": "347.00",
"attr2": "7",
"attr3": "未払い",
"hitContent": "PO23434523566",
"tabId": "4"
},
{
"id": 5,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/4.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服4",
"attr1": "346.00",
"attr2": "6",
"attr3": "未発送",
"hitContent": "TN2334232456",
"tabId": "4"
},
{
"id": 4,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/3.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服3",
"attr1": "345.00",
"attr2": "5",
"attr3": "発送済み",
"hitContent": "AC234123239923",
"tabId": "4"
},
{
"id": 3,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/2.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服2",
"attr1": "344.00",
"attr2": "4",
"attr3": "配送中",
"hitContent": "CH2341553222223",
"tabId": "4"
},
{
"id": 2,
"img": "http://pro-km.oss-cn-hangzhou.aliyuncs.com/demo/product_card/1.png",
"title": "某某牌男装 新款polo衫男短袖韩版潮流宽松休闲翻领男士T恤上衣",
"subTitle": "良質服1",
"attr1": "343.00",
"attr2": "3",
"attr3": "完了",
"hitContent": "ZH23412333456",
"tabId": "4"
}
]
}
}
2.3. バブルノードリスト(物流情報)
リクエストパラメータ
リクエストボディ
| パラメータ |
型 |
必須 |
説明 |
| taskNodeId |
Integer |
true |
ノードID, 現在のタスク型セッションが滞在しているノードのID |
| sessionId |
Integer |
true |
セッションID, 対話記録のID |
| timestamp |
Long |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| variables |
Map |
false |
変数Map, タスクツリー設定で収集された変数 |
| pageNum |
Integer |
true |
ページ番号 |
| pageSize |
Integer |
true |
1ページあたりの表示件数 |
| customerExtra |
Object |
false |
カスタマーカスタム追加オブジェクト |
| customerExtra.customerId |
Integer |
false |
カスタマーサポートシステムのユーザーID |
| customerExtra.callerNumber |
String |
false |
音声ロボットの発信者番号(このフィールドは音声ロボットで使用) |
| customerExtra.dialogueDesc |
String |
false |
このフィールドの使用は特殊で、カスタマーがロボットとの対話Webhookにカスタム情報を渡すニーズを満たすためです。まず、カスタマーサポートシステムのカスタマーカスタムフィールド内に、c_cf_dialogueDescという名前のカスタムフィールドを設定する必要があります。カスタマーのこのフィールド値を設定できます。その後、チャットプラグインを開き、このフィールドをパスパラメータに追加します。形式は以下の通りです:https://xxx.udesk.cn/im_client/?web_plugin_id=41597&c_cf_dialogueDesc=*******。これにより、システムは自動的にこのパラメータ値をdialogueDescパラメータとしてWebhookのリクエストパラメータの一つに渡します。特別な注意:カスタマーサポートシステムとパスパラメータの受け渡しはどちらもc_cf_dialogueDescというパラメータ名で行われます。 |
| ##### リクエスト結果 |
|
|
|
| パラメータ |
タイプ |
必須 |
説明 |
| code |
Integer |
はい |
200は成功を表します |
| data |
Object |
はい |
|
| data.title |
String |
はい |
タイトル |
| data.subTitle |
String |
はい |
サブタイトル |
| data.dataList |
Array |
はい |
|
| data.dataList[].id |
String |
|
|
| data.dataList[].status |
String |
|
物流ステータス |
| data.dataList[].title |
String |
|
タイトル |
| data.dataList[].subTitle |
String |
|
サブタイトル |
例
## appKey:abcde
## sign:md5Hex(abcde1001001551510709)
$ curl 'http://demo.km.tryudesk.com/expressInfo ' -X POST -H 'Content-Type: application/json' -d '{
"taskNodeId" : 1,
"sessionId" : 1,
"timestamp" : 1551510709,
"sign" : "9195e2a5c1d84b86dc59819f29a0e300",
"pageSize":5,
"pageNum":1
}'
レスポンス
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"title": "必要な商品を選択してください",
"subTitle": "円通速達T2342452342",
"dataList": [
{
"id": "1",
"status": "受領済み",
"title": "ご注文は本人が受領しました。ご不明な点がございましたら、配達員【段毅, 13800000000】にご確認ください。京东でのお買い物ありがとうございます。またのご利用をお待ちしております。",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "2",
"status": "輸送中",
"title": "ご注文は京东【北京順和営業部】に到着しました",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "3",
"status": "輸送中",
"title": "ご注文は京东【北京順義仕分けセンター】から【北京豊華営業部】へ配送中です",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "4",
"status": "輸送中",
"title": "ご注文は京东【北京順義仕分けセンター】で仕分け完了しました",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "5",
"status": "輸送中",
"title": "ご注文は京东【北京李橋受入倉】から【北京順義仕分けセンター】へ配送中です",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "6",
"status": "出庫済み",
"title": "ご注文は京东【北京李橋受入倉】で仕分け完了しました",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "7",
"status": "倉庫処理中",
"title": "サードパーティ販売者がピッキングを開始しました",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "8",
"status": "倉庫処理中",
"title": "ご注文はサードパーティ販売者倉庫に入庫し、出庫準備中です",
"subTitle": "2020-08-08 18:59:59"
},
{
"id": "9",
"status": "注文済み",
"title": "注文を送信しました。サードパーティ販売者システムの確認をお待ちください",
"subTitle": "2020-08-08 18:59:59"
}
]
}
}
三、ナレッジベース取得型
認証方式
計算式
sign=sha256Hex(api×tamp)
ここで:
- api: 認証キー、Webhookで設定されたkey
- timestamp: タイムスタンプ、'1970-01-01 00:00:00'からの秒数
- データ間は&記号で連結する
認証データ例
| 名称 |
値 |
| key |
123456 |
| timestamp |
1551510709 |
署名の計算:
sign = sha256Hex("123456&1551510709")
リクエストアドレス
- POST HOST/{relative address}
リクエストパラメータ
リクエストボディ
| Path |
Type |
Required |
Description |
| timestamp |
Integer |
true |
タイムスタンプ |
| sign |
String |
true |
署名 |
| datumId |
Integer |
false |
ナレッジID |
| datumName |
String |
false |
ナレッジ名 |
| sessionId |
Integer |
true |
セッションID |
| templateAttributeId |
Integer |
true |
テンプレート属性ID |
| templateAttributeName |
String |
true |
テンプレート属性名 |
| customer |
Object |
false |
カスタマーカスタム追加オブジェクト |
レスポンス結果
| Path |
Type |
Description |
| resCode |
Integer |
レスポンスコード【0成功/-1失敗】 |
| resError |
String |
エラーメッセージ |
| message |
Object |
ユーザーメッセージ |
| message.msgType |
String |
メッセージタイプ(空でも可) |
| message.msgContent |
String |
メッセージ内容 |
例
$ curl 'HOST/API' -i -X POST -H 'Content-Type: application/json' -d '{
"timestamp" : 1513150103,
"sign" : "ab991af4ef65fc6061cf16c19d7d9d1bc1e12dcb",
"datumId" : 1,
"datumName" : "ナレッジ名",
"sessionId" : 123,
"templateAttributeId" : 456,
"templateAttributeName" : "テンプレート属性名",
"customer" : {
"origin_id" : 666,
"customer_token" : "123456",
"nick_name" : "ニックネーム",
"c_email" : "123@163.com"
}
}'
レスポンス
{
"resCode" : 0,
"resError" : "",
"message" : {
"msgType" : "",
"msgContent" : "メッセージ内容"
}
}