简体   繁体   English

Dialogflow 身份验证 API v2 - HTTP POST

[英]Dialogflow authentication API v2 - HTTP POST

I´m using dialogflow with http request on a project that works in twilio, with the recent need of migration to v2 API of dialogflow the client access token will not work.我在一个在 twilio 中工作的项目上使用带有 http 请求的对话流,最近需要迁移到对话流的 v2 API,客户端访问令牌将不起作用。 Reading the new authentication, I generated the json following the instructions in the google cloud docs, but can´t make it works.阅读新的身份验证后,我按照谷歌云文档中的说明生成了 json,但无法使其正常工作。 Because I need to do all the interaction through POST requests to the dialogflow agent, does anyone know how I can generate the authentication token well?因为我需要通过 POST 请求对 dialogflow 代理进行所有交互,所以有人知道我如何很好地生成身份验证令牌吗?

{
    "error": {
        "code": 401,
        "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
        "status": "UNAUTHENTICATED"
    }
}

Thanks谢谢

This is the function code that today works to make the http request.这是今天用来发出http请求的函数代码。 The problem is that all the services are in Twilio and i dont have access to the server, for that I cant define the environment variable.问题是所有服务都在 Twilio 中,我无权访问服务器,因此我无法定义环境变量。

Twilio Function code Twilio 函数代码

Twilio Fuctions uses NodeJs and allow me to install many npm modules, with the following limitation: "Native Packages Not Supported - Functions does not provide a C/C++ compliler required to complie native addon modules. This means modules that depend on node-gyp can not be installed to Functions." Twilio Fuctions 使用 NodeJs 并允许我安装许多 npm 模块,但有以下限制:“不支持本机包 - Functions 不提供编译本机插件模块所需的 C/C++ 编译器。这意味着依赖于 node-gyp 的模块可以不能安装到 Functions 中。”

I don´t know if this limitations affect service acount working to me in this case.在这种情况下,我不知道此限制是否会影响对我工作的服务帐户。

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

相关问题 Bing Ads API v2 oAuth2 - Bing Ads API v2 oAuth2 使用Google Apps脚本(OAuth v2)访问Shoeboxed API - Accessing Shoeboxed API with Google Apps Script (OAuth v2) Google Apps脚本中的Dropbox API v2 /删除 - Dropbox API v2 /delete in Google Apps Script 电子邮件迁移API v2:Google Apps脚本 - Email Migration API v2: Google Apps Script 从 Twitter API V1.1 切换到 Twitter ZDB974238714CA8DE634A7CE1Dweets a Profile to GoogleF Sheet4 to send to Google F Sheets2 - Switching from Twitter API V1.1 to Twitter API V2 to send Tweets from a Profile to Google Sheets Google AppsScript和Drive API v2-以编程方式更改Google平台项目 - Google AppsScript and Drive API v2 - Change google platform project programmatically Google Drive API v2-列出所有标签/限制为false的文件 - Google Drive API v2 - list all files that label/restricted = false Google Apps脚本中的Google Drive REST API v2文件属性数组未定义吗? - Google Drive REST API v2 file properties array in Google Apps Script is undefined? 将 coinmarketcap api v2 与谷歌表一起使用 - 通过多次调用添加到 js 对象 - Using coinmarketcap api v2 with google sheets - adding to js object with multiple calls 类型错误:无法读取未定义的属性“hasOwnProperty” - Twitter API V2 与 GAS - TypeError: Cannot read property 'hasOwnProperty' of undefined - Twitter API V2 vs. GAS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM