简体   繁体   English

Dialogflow-履行请求的有效负载-如何使用在请求有效负载中收到的用户ID注册用户

[英]Dialogflow - Fulfillment request pay load - How to register the user with user id received in request payload

What are the google/Microsoft(Skype) APIs available in order to register user in my application with the same user id as received in fulfillment request payload to my web hook? 有哪些google / Microsoft(Skype)API可用于在我的应用程序中以与实现请求有效负载中收到的用户ID相同的用户ID在我的Web挂钩中注册用户?

I receive following for skype: 我收到以下关于Skype的信息:

{  
   "originalDetectIntentRequest":{  
      "source":"skype",
      "payload":{  
         "user":{  
            "name":"Sana Zehra",
            "id":"29:1I3o3Np8sTLU7YSuhHO-IDuc1SgqMwg-83YwGryAZceE"
         }
      }
   }
}

For Google I receive this: 对于Google,我收到以下信息:

    {  
   "originalDetectIntentRequest":{  
      "payload":{  
         "user":{  
            "lastSeen":"2019-01-02T07:57:02Z",
            "locale":"en-US",
            "userId":"ABwppHHxPEyGWY1R26WqV3o5i1w8YNGbAIn5TXd28cre8Eu3iWtPlJEMuSzPWIW1b5u8e94djCv1xvmszegO1Q"
         }
      }
   }
}

I need to register my users with this id as I authenticate if an incoming request is a registered user or not. 如果传入请求是否为注册用户,我需要使用该ID注册我的用户,以进行身份​​验证。

You would need to build a flow for registration something that allows you to gather all the required information and register the user at your end, you can then verify if the user is registered by validating them against their id. 您将需要构建一个注册流程,以使您可以收集所有必需的信息并在最终注册用户,然后可以通过根据其ID验证用户的身份来验证用户是否已注册。

A sample article that handles the user registration via chatbot scenario: https://medium.com/@sage.mcenery/building-a-registration-chatbot-on-aws-with-lex-and-twilio-4a14c15b8725 通过聊天机器人场景处理用户注册的样本文章: https ://medium.com/@sage.mcenery/building-a-registration-chatbot-on-aws-with-lex-and-twilio-4a14c15b8725

You can use google helpers in case of assistant which can give you the following additional info about the user: Display name, Given name, Family name, Coarse device location (zip code and city), Precise device location (coordinates and street address) 您可以在助理的情况下使用google helper,它可以为您提供有关用户的以下附加信息:显示名称,姓氏,姓氏,粗略的设备位置(邮政编码和城市),精确的设备位置(坐标和街道地址)

Documentation on the same: https://developers.google.com/actions/assistant/helpers#built-in_helper_intents 相同的文档: https : //developers.google.com/actions/assistant/helpers#built-in_helper_intents

I've never tried this myself though so I'm not too sure about this. 我自己从来没有尝试过,所以我对此不太确定。

I do not think Skype and Google will give you much info about the user if that's what your looking for but a unique id against the user should do the trick in most cases. 我不认为Skype和Google不会为您提供有关该用户的大量信息,如果您正在寻找的是,但是在大多数情况下,针对该用户的唯一ID应该可以解决问题。

Neither ID has any direct relation to the user's account on that platform. 这两个ID均与该平台上的用户帐户没有任何直接关系。

Furthermore, the userId provided on the Actions on Google platform has been deprecated, and is scheduled to be removed in May 2019. 此外,已弃用Google平台上的操作上提供的userId ,并计划于2019年5月将其删除

The suggested way to associate the user's Google account with their session with you is to use Google Sign In for Assistant . 将用户的Google帐户与您的会话相关联的建议方法是使用Google登录助手 With the user's one-time permission, you can then get their Google profile ID and other profile information. 获得用户的一次性许可后,您便可以获取其Google个人资料ID和其他个人资料信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM