UiM 聊天機器人 – 介接文件

回傳為 json 結構

所有回傳資料包含

  1. Status: 表示呼叫成功或是失敗
  2. Data: 回傳的資料結構
  3. Msg: 訊息內容 (不一定有值)

  • 查詢聊天室使用者清單
    https://uim.diameter.com.tw/chatbot/getList
    method: POST
    Data: api_key={api-key}
    Response:

    {
      "status": true,
      "msg": "",
      "data": {
        "dialog": {
          "name": "牛牛测试",
          "created_at": "2018-05-09T07:11:16Z",
          "updated_at": "2018-05-09T10:32:21Z",
          "last_message": "好"
        },
        "users": {
          "33373629": {
            "full_name": "kuann",
            "deviceModel": "",
            "lastLoginIP": null,
            "locale": "",
            "_created_at": null,
            "_last_request_at": null
          },
          "34094947": {
            "full_name": "最好的",
            "deviceModel": "iPhone9,4",
            "lastLoginIP": "182.232.181.33",
            "locale": "zh-tw",
            "_created_at": null,
            "_last_request_at": "2018-05-09 18:55:48"
          },
          "36491109": {
            "full_name": "kuanntw",
            "deviceModel": "CPH1607",
            "lastLoginIP": "110.50.137.216",
            "locale": "zh-TW",
            "_created_at": null,
            "_last_request_at": "2018-05-09 20:38:44"
          },
          "45151929": {
            "full_name": "象牙",
            "deviceModel": "ASUS_Z00AD",
            "lastLoginIP": "182.232.180.234",
            "locale": "zh-TW",
            "_created_at": "2018-03-31 07:59:22",
            "_last_request_at": "2018-05-09 18:40:55"
          }
        }
      }
    }
    

     


  • 查詢聊天室內容
    https://uim.diameter.com.tw/chatbot/getMessage
    method: POST
    Data: api_key={api-key}
    Response:

    {
      "status": true,
      "msg": "",
      "data": [
        {
          "_id": "5af2ce35f001709504004674",
          "attachments": [],
          "created_at": "2018-05-09T10:32:21Z",
          "message": "好",
          "type": "text"
        },
        {
          "_id": "5af2ce0a418412785601c46a",
          "attachments": [],
          "created_at": "2018-05-09T10:31:39Z",
          "message": "晚上应该可以提供让他呼叫",
          "type": "text"
        },
        {
          "_id": "5af2cd44f00170950400465a",
          "attachments": [],
          "created_at": "2018-05-09T10:28:20Z",
          "message": "有什麼進展嗎?",
          "type": "text"
        },
        {
          "_id": "5af2ca7d418412785601c464",
          "attachments": [],
          "created_at": "2018-05-09T10:16:29Z",
          "message": "没事,在测试而已",
          "type": "text"
        },
        {
          "_id": "5af2ca6ff001709504004648",
          "attachments": [],
          "created_at": "2018-05-09T10:16:15Z",
          "message": "?",
          "type": "text"
        },
        {
          "_id": "5af2c9f5418412785601c456",
          "attachments": [],
          "created_at": "2018-05-09T10:14:13Z",
          "message": "sssss",
          "type": "text"
        },
        {
          "_id": "5af2c9e0685a8742b300001e",
          "attachments": [],
          "created_at": "2018-05-09T10:13:55Z",
          "message": "test2"
        },
        {
          "_id": "5af29f58f001702304004405",
          "attachments": [],
          "created_at": "2018-05-09T07:12:24Z",
          "message": "好",
          "type": "text"
        },
        {
          "_id": "5af29f52708acac98b4e7209",
          "attachments": [],
          "created_at": "2018-05-09T07:12:17Z",
          "message": "别急",
          "type": "text"
        },
        {
          "_id": "5af29f4a708acac98b4e71ff",
          "attachments": [],
          "created_at": "2018-05-09T07:12:09Z",
          "message": "我这边还没好",
          "type": "text"
        },
        {
          "_id": "5af29f47f0017023040043f2",
          "attachments": [],
          "created_at": "2018-05-09T07:12:07Z",
          "message": "?",
          "type": "text"
        },
        {
          "_id": "5af29f41708acac98b4e71f4",
          "attachments": [],
          "created_at": "2018-05-09T07:12:00Z",
          "message": "不用",
          "type": "text"
        },
        {
          "_id": "5af29f3af0017023040043e1",
          "attachments": [],
          "created_at": "2018-05-09T07:11:55Z",
          "message": "等等",
          "type": "text"
        },
        {
          "_id": "5af29f31f0017023040043df",
          "attachments": [],
          "created_at": "2018-05-09T07:11:45Z",
          "message": "up",
          "type": "text"
        },
        {
          "_id": "5af29f2af0017023040043d7",
          "attachments": [],
          "created_at": "2018-05-09T07:11:38Z",
          "message": "好",
          "type": "text"
        },
        {
          "_id": "5af29f1d708acac98b4e71c9",
          "attachments": [],
          "created_at": "2018-05-09T07:11:24Z",
          "message": "测试一下",
          "type": "text"
        }
      ]
    }
    

  • 發送聊天室訊息
    https://uim.diameter.com.tw/chatbot/sendMessage
    method: POST
    Data: api_key={api-key}
    msg=your-own-message (訊息內容須以 Base64 編碼過)
    Response:

    {
      "status": true,
      "msg": "",
      "data": {
        "_id": "5af5b72c3107c04793d64ea0",
        "created_at": "2018-05-11T15:30:52Z",
        "sender_id": 36491109,
        "message": " your-own-message"
      }
    }
    

     


  • 上傳圖片檔
    https://uim.diameter.com.tw/chatbot/uploadFile
    method: POST
    Data: api_key={api-key}
    file={form 格式的 file}
    Response:

    {
      "status": true,
      "msg": "",
      "data": {
        "_id": "5af851fa3107c012c1d6524f",
        "created_at": null,
        "sender_id": 36491109,
        "attachments": [
          {
            "type": "image",
            "id": "8816057"
          }
        ]
      }
    }
    

     

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *