簡體   English   中英

嘗試使用 Google 時出錯 Gmail API

[英]Error when trying to use Google Gmail API

我正在嘗試自動向一群人發送電子郵件。 我使用 credentials.json 進行身份驗證,示例代碼來自 gmail api 的站點。 錯誤: An error occurred: <HttpError 403 when requesting https://gmail.googleapis.com/gmail/v1/users/,<the account I used>/messages/send?alt=json returned "Request had insufficient authentication scopes.">認證過程哪里出了問題?

Gmail API 快速入門中的示例代碼包含 scope 'https://www.googleapis.com/auth/gmail.readonly'

但是,要發送消息,您需要以下范圍之一:

將代碼中的 scope 更改為列出的代碼之一,並刪除令牌文件以在使用新的 scope 運行代碼時觸發新的授權流程。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM