如何使用环聊聊天API将文件发送到聊天机器人

时间:2018-06-18 14:29:17

标签: hangouts-chat

环聊聊天是否允许将文件发送到聊天机器人?

我尝试在直接邮件中上传文件并将其发送到我的聊天机器人但我在请求中没有收到有关该文件的任何信息。我做错了什么或者根本不被允许?

https://developers.google.com/hangouts/chat/reference/message-formats/events

这是请求......

{
  "type": "MESSAGE",
  "eventTime": "2018-06-18T15:14:00.392719Z",
  "token": "<MY_TOKEN>",
  "message": {
    "name": "spaces/<SPACE_ID>/messages/<MESSAGE_ID>",
    "sender": {
      "name": "<USER>",
      "displayName": "<NAME>",
      "avatarUrl": "<AVATAR_URL>",
      "email": "<EMAIL>",
      "type": "HUMAN"
    },
    "createTime": "2018-06-18T15:14:00.392719Z",
    "thread": {
      "name": "spaces/<SPACE_ID>/threads/<THREAD_ID>",
      "retentionSettings": { 
        "state": "PERMANENT"
      }
    },
    "space": {
      "name": "spaces/<SPACE_ID>",
      "type": "DM"
    },
  },
  "user": {
    "name": "<USER>",
    "displayName": "<NAME>",
    "avatarUrl": "<AVATAR_URL>",
    "email": "<EMAIL>",
    "type": "HUMAN"
  },
  "space": { 
    "name": "spaces/<SPACE_ID>",
    "type": "DM"
  },
  "configCompleteRedirectUrl": "https://chat.google.com/api/bot_config_complete?token\<TOKEN>"
}

0 个答案:

没有答案