无法通过bot框架发布消息

时间:2018-01-06 18:18:36

标签: rest botframework slack-api

我正在尝试为新用户发布欢迎消息。

以下是我收到的请求,当用户将我的机器人添加到他/她的闲散组时。

{
    "type":"installationUpdate",
    "id":"ID",
    "timestamp":"2018-01-06T14:41:32.4393782Z",
    "serviceUrl":"https:\/\/slack.botframework.com",
    "channelId":"slack",
    "from":{
        "id":"ID",
        "name":"Name"
    },
    "conversation":{
        "isGroup":false,
        "id":"ID:"
    },
    "recipient":{
        "id":"ID",
        "name":"Name"
    },
    "channelData":{
        "SlackMessage":{
            "type":"bot_added",
            "subtype":"none",
            "ts":"1515249692",
            "event_ts":"1515249692",
            "bot":{
                "id":"bot_id",
                "app_id":"app_id",
                "deleted":false,
                "name":"career_buddy"
            }
        },
        "ApiToken":"api token"
    },
    "action":"add"
}

如果请求类型为installationUpdate,我将活动json对象发布到网址https://slack.botframework.com/v3/conversations/{ConversationID}/activities

这是我的活动json对象

{
    "type":"message",
    "conversation":{
        "id":"ID:"
    },
    "recipient":{
        "id":"ID",
        "name":"name"
    },
    "from":{
        "id":"ID",
        "name":"name"
    },
    "channelId":"slack",
    "text":"Hello"
}

发布时,我的状态为200 OK。

但该卷曲帖子的回复是空的({}),而且我也没有在Slack中收到任何消息。

0 个答案:

没有答案