gpt4 book ai didi

hangouts-chat - 如何在谷歌环聊中删除 Webhook 发送的消息

转载 作者:行者123 更新时间:2023-12-03 17:30:01 24 4
gpt4 key购买 nike

我关注了 incoming bot python用 webhook 发送消息,我想用 Method:delete 删除它.
但我收到错误 401,以下是错误消息。

{'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'}}

Webhook 似乎使用 key 和 token 作为授权。但是我无法删除具有相同 url(目标为“data-id”)的消息。

最佳答案

您必须已下载凭据文件。如果没有,请关注 this .

下载后,请按照以下步骤生成身份验证 token 。

  • 设置环境变量

    导出 GOOGLE_APPLICATION_CREDENTIALS=
  • 在终端上运行此命令。

    gcloud 身份验证应用程序默认打印访问 token
  • 在 Postman -> Authorization -> Type OAuth 2.0 -> Access token 中使用生成的 token
    或者
    在你的标题中

    标题 = {
    '内容类型':“应用程序/json”,
    '授权':“承载”,
    ...
    }
  • 关于hangouts-chat - 如何在谷歌环聊中删除 Webhook 发送的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56338200/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com