0

我已经在 Python 3.5 中使用 Kik Api 创建了代码,但是当我试图获取聊天 ID 时,我已经停滞不前了。我已经搜索过了,但我不知道使用 api 来找到一个聊天 id 来发送消息。你如何通过api获取聊天ID?我的代码在这里: http: //pastebin.com/LP8ahhhd

4

2 回答 2

0

当您收到一条消息时,它看起来像这样

{
    "messages": [
        {
            "chatId": "0ee6d46753bfa6ac2f089149959363f3f59ae62b10cba89cc426490ce38ea92d",
            "id": "0115efde-e54b-43d5-873a-5fef7adc69fd",
            "type": "text",
            "from": "laura",
            "participants": ["laura"],
            "body": "omg r u real?",
            "timestamp": 1439576628405,
            "readReceiptRequested": true,
            "mention": null
        },
        {
            "chatId": "0ee6d46753bfa6ac2f089149959363f3f59ae62b10cba89cc426490ce38ea92d",
            "id": "74ded818-1eb7-4266-91bc-c301c2f41fe3",
            "type": "picture",
            "from": "aleem",
            "participants": ["aleem"],
            "picUrl": "http://example.kik.com/apicture.jpg",
            "timestamp": 1439576628405,
            "readReceiptRequested": true,
            "mention": null
        }
    ]
}

chatId您可以从chatId收到的消息中获取适当的

于 2016-08-15T15:06:44.143 回答
0

如果我没记错的话,您发布的代码中有一个chatID 字段吗?您需要使用它将消息发送回同一对话。有关更多信息,请参见此处:https ://dev.kik.com/#/docs/messaging#sending-messages

于 2016-08-15T04:43:43.250 回答