我正在使用Skype集成在Dialogflow中开发一个聊天机器人。我使用Node.js作为我在公司Amazon实例中托管的服务。一切对我来说都很好,但我想验证用户以应用身份验证。以下是从Skype到Node.js服务器的传入请求。我想用以下信息检查用户的Skype显示名称。请指教
{
"responseId": "a11dcea4-4139-4da0-acac-5ff0f2960a71",
"queryResult": {
"queryText": "Hi",
"action": "input.welcome",
"parameters": {},
"allRequiredParamsPresent": true,
"intent": {
"name": "projects/grantthornton-f364a/agent/intents/6cb8b646-1987-4c61-967a-523d6f95120c",
"displayName": "Default Welcome Intent"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
},
"originalDetectIntentRequest": {
"source": "skype",
"payload": {
"data": {
"agent": "botbuilder",
"attachments": [],
"address": {
"bot": {
"name": "Grant Thornton",
"id": "28:dc14d048-a865-4a7e-b858-77c816168d41"
},
"serviceUrl": "https://smba.trafficmanager.net/apis/",
"id": "1537967468315",
"user": {
"id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
},
"conversation": {
"id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
},
"channelId": "skype"
},
"entities": [
{
"country": "US",
"type": "clientInfo"
}
],
"sourceEvent": {
"text": "Hi"
},
"text": "Hi",
"source": "skype",
"type": "message",
"user": {
"id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
},
"timestamp": "2018-09-26T13:11:08.324Z"
},
"source": "skype"
}
},
"session": "projects/grantthornton-f364a/agent/sessions/a8c89625-dbeb-441f-ac1c-ad31f10a5afe"
}
答案 0 :(得分:1)
您在此处拥有的唯一用户信息是
"id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
您可以通过直接查询Skype API获取其他用户数据来使用。
请注意:仅获得用户的显示名称,不会处理身份验证。