[英]two api calls in custom alexa skill
I've asked this question here , but it may be a little too in depth for everyone to read through, but i suppose my basic question could be reduced to:我在这里问过这个问题,但对于每个人来说阅读可能有点太深入了,但我想我的基本问题可以简化为:
is it possible to do two separate API calls within the same piece JS code when writing a custom alexa skill?编写自定义 alexa 技能时,是否可以在同一块 JS 代码中执行两个单独的 API 调用?
Here's my logic这是我的逻辑
4.create new API url with returned friends IDs 4.使用返回的好友ID创建新的API url
5.call new URL to get friends online status and names 5.调用新网址获取好友在线状态和姓名
6.return these details to alexa to sort and determine online status 6.将这些详细信息返回给alexa以排序和确定在线状态
7.construct speech response 7.构建语音响应
8.say response 8.说回应
I've got it as far as constructing the API url with the friends IDs but it appears that my second API call either isn't working or i'm just not accessing it properly.就使用朋友 ID 构建 API url 而言,我已经掌握了它,但似乎我的第二个 API 调用要么不起作用,要么我没有正确访问它。
any thoughts would be helpful.任何想法都会有所帮助。
Yes, your code can do anything you want (including multiple external API calls) in the process of handling an Alexa request, but you can only return one response to Alexa in fulfillment its request.是的,在处理 Alexa 请求的过程中,您的代码可以做任何您想做的事情(包括多个外部 API 调用),但您只能向 Alexa 返回一个响应以完成其请求。
The steps could be itemized like this这些步骤可以像这样逐项列出
Does that clear things up?这能解决问题吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.