I am trying to use the updateIntent function that is part of the Dialogflow v2 Client library for Node.js . The reason I am trying to use it, is to be able to add training phrases to an intent.
I cannot seem to get passed this one. Here is the code I am using for it!:
My GetIntent Function:
async function getIntent(intentId) {
try {
let responses = await intentsClient.getIntent({name: intentId, intentView: 'INTENT_VIEW_FULL'})
const response = responses[0]
// console.log(response)
return …Run Code Online (Sandbox Code Playgroud) 从https://developers.google.com/vault/guides/exports 上的文档中,我已经能够创建、列出和检索导出,但我还没有找到任何方法来下载与特定关联的导出数据出口。有什么办法可以通过 API 下载导出的文件,还是只能通过 Vault UI 下载?
cloudStorageSink导出元数据中有一个键,但尝试使用使用云存储 API 提供的值会导致通用权限问题(403 错误)。
示例导出元数据响应:
{
"status": "COMPLETED",
"cloudStorageSink": {
"files": [
{
"md5Hash": "da5e3979864d71d1e3ac776b618dcf48",
"bucketName": "408d9135-6155-4a43-9d3c-424f124b9474",
"objectName": "a740999b-e11b-4af5-b8b1-6c6def35d677/exportly-41dd7886-fe02-432f-83c-a4b6fd4520a5/Test_Export-1.zip",
"size": "37720"
},
{
"md5Hash": "d345a812e15cdae3b6277a0806668808",
"bucketName": "408d9135-6155-4a43-9d3c-424f124b9474",
"objectName": "a507999b-e11b-4af5-b8b1-6c6def35d677/exportly-41dd6886-fb02-4c2f-813c-a4b6fd4520a5/Test_Export-metadata.xml",
"size": "8943"
},
{
"md5Hash": "21e91e1c60e6c07490faaae30f8154fd",
"bucketName": "408d9135-6155-4a43-9d3c-424f124b9474",
"objectName": "a503959b-e11b-4af5-b8b1-6c6def35d677/exportly-41dd6786-fb02-42f-813c-a4b6fd4520a5/Test_Export-results-count.csv",
"size": "26"
}
]
},
"stats": {
"sizeInBytes": "46689",
"exportedArtifactCount": "7",
"totalArtifactCount": "7"
},
"name": "Test Export",
...
}
Run Code Online (Sandbox Code Playgroud) 使用时
使用此代码通过 Flutter 访问 Google Api
import 'dart:convert';
import 'dart:io';
import 'package:googleapis_auth/auth.dart';
import 'package:googleapis_auth/auth_browser.dart';
import 'package:googleapis_auth/auth_io.dart';
import 'package:googleapis/androidpublisher/v3.dart';
Future main() async {
dynamic jsonData = json.decode(
await File('api-xxxxxxxxxxxxxxxxxxxx.json')
.readAsString());
var scopes = [AndroidpublisherApi.AndroidpublisherScope];
final accountCredentials = new ServiceAccountCredentials.fromJson(jsonData);
AuthClient client = await clientViaServiceAccount(accountCredentials, scopes);
}
Run Code Online (Sandbox Code Playgroud)
你会得到这个错误
错误:未找到:'dart:html' 将 'dart:html' 导入为 html;
我正在创建一个 Gmail 插件,我的疑问是如何在 Google 端保存一些安全和机密的信息,以便稍后在我的代码中使用它。Google 是否提供某种安全存储机制?
google-api google-apps-script google-apps-marketplace gmail-addons google-workspace
我有一个很长一段时间没有接触过的非常古老的 Android 项目。它将一些用户数据存储在用户 Google Drive appdata 文件夹中。现在我正在将应用程序更新为 Flutter 版本,并且由于 Google Drive API 已被弃用,因此 Flutter 没有插件,我相信我现在需要为此使用 googleapi。但是我找不到太多关于我的颤振问题的信息。我到了使用 google_sign_in 登录的地步:^4.0.7
GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: [
'email',
'https://www.googleapis.com/auth/drive.appdata',
'https://www.googleapis.com/auth/drive.file',
],
);
try {
GoogleSignInAccount account = await _googleSignIn.signIn();
} catch (error) {
print(error);
}
Run Code Online (Sandbox Code Playgroud)
这工作正常,但我被困在那里。如何从那里读取用户 Google Drive 上 appdata 文件夹中的文件?
EDIT1:这个答案有帮助,我设法获得了 httpClient,但我仍然坚持如何获得 appdata 文件夹及其文件如何在 Flutter中使用 Google API?
googleapi 似乎不支持 appfolder,因为 Google 可能会在未来弃用它(似乎他们已经这样做了),以迫使我们使用 firebase 支付存储费用。好的,很好,但是如果我无法通过 googleapi 访问该文件夹,我该如何迁移它?如果我现在重置我的应用程序并且我的用户丢失了他们的所有数据,我将丢失我拥有的少数用户......
我刚刚添加"@google-cloud/logging-winston":"2.1.0",到我的 pacakge.json 中,当我编译时出现以下错误。我偶尔会在其他 google 库中看到这种情况,其根本原因很可能在 protobuf 定义自动生成的类型的堆栈中更深。
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1434:32 - error TS2304: Cannot find name 'Long'.
1434 line?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1453:38 - error TS2304: Cannot find name 'Long'.
1453 public line: (number|Long);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1543:39 - error TS2304: Cannot find name 'Long'.
1543 requestSize?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1549:40 - error TS2304: Cannot find name 'Long'.
1549 responseSize?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1576:42 - error TS2304: Cannot find name 'Long'.
1576 cacheFillBytes?: (number|Long|null);
Run Code Online (Sandbox Code Playgroud) 这是我的代码的一部分:
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
Run Code Online (Sandbox Code Playgroud)
如果信用证过期,则必须刷新。在 Windows 上这部分工作,但在 Linux 上我得到一个错误(在最后一个字符串上):
('invalid_scope: Some requested scopes were invalid. {invalid=[a, c, d, e, g, h, i, l, m, ., /, o, p, r, s, t, u, v, w, :]}', '{\n "error": "invalid_scope",\n "error_description": "Some requested scopes were invalid. {invalid\\u003d[a, c, d, e, g, h, i, l, m, ., /, o, p, r, s, t, …Run Code Online (Sandbox Code Playgroud) 我遵循了谷歌提供的使用 Python的快速入门,我使用了谷歌给出的适当范围从驱动器https://www.googleapis.com/auth/drive.readonly下载文件,但我不断收到错误:
googleapiclient.errors.HttpError: https://www.googleapis.com/drive/v3/files/1RWpLGCWldcJyVqa0tIVlScg60ExEtcNIvJ7R9M8DuhM?alt=media 返回“只能下载包含二进制内容的文件。使用 Google Docs 文件导出。”
当我尝试运行代码来下载文件时。
我可以读取驱动器上的文件,但尽管我尽了最大的努力,但我似乎无法从驱动器下载特定的电子表格。下面是我用于通过 API 建立连接的代码(已编辑的文件路径和一些注释):
def gsuite_connect():
file_path = 'OMITTED/Loading'
# Get what permissions the user (using the API) will need. This as been set to high level
# access by default
scopes = ['https://www.googleapis.com/auth/drive.readonly']
# Access the tokens for G Suite to access the Drive. Ensure that if this file previous exists,
# that it is in the current working directory
store = file.Storage(os.path.join(file_path, 'storage.json'))
# Access the …Run Code Online (Sandbox Code Playgroud)我希望达到的目标:
每当我的共享驱动器上的任何谷歌工作表中的单元格(由域中的任何用户)更改时,我都想调用 API 端点并包含有关编辑了哪个单元格的信息。
我的方法:我相信 Google App Scripts Add-on 是我所需要的。为域上的所有用户安装。
我看到有“绑定”脚本和独立脚本。对于独立脚本,除了基于计时器和日历的触发器之外,我无法创建任何其他触发器。绑定脚本似乎永久绑定到单个工作表,不会以任何方式影响其他工作表。
我错过了什么?
我在博客上找到了一些用于制作绑定脚本的端到端教程,但没有关于通用跨域内容的教程。
google-api google-apps-script google-apps-script-addon google-drive-shared-drive
初始情况:
当前的问题:
我们尚未收到来自 Google 的任何关于日历 API 更改或我们帐户限制的警告/警报。此外,我还没有发现任何有关 Google 日历的公开已知问题/中断。
可能是什么问题呢?
我应该向 Google 报告吗?如果是,具体如何?我所能找到的只是一个“谷歌云平台免费试用疑难解答”,其中(除了建议使用 stackoverflow ;])我可以用“特定问题和技术支持”做的所有事情就是“开始聊天”,这会导致到 Google 内部网站 (moma)。还有什么我可以尝试的吗?
任何帮助将非常感激!
更新: 官方文件中有间接跟踪/暗示,谷歌已经改变了这种(自动)接受共享日历的行为 - 比较“共享现有日历”部分的当前版本和 2019 年 8 月版本:
更新 2 由于@DaImTo(需要谷歌帐户),我设法向谷歌报告了这个问题:https ://issuetracker.google.com/issues/148804709
要点如下:
google-calendar-api google-api google-oauth service-accounts
google-api ×10
python ×3
flutter ×2
node.js ×2
credentials ×1
dart ×1
gmail-addons ×1
google-oauth ×1
typescript ×1