我編寫了一個腳本來連接到Google電子表格,並從中將數據加載到postgresql數據庫中。 我已經創建了一個服務帳戶,並在以.json格式獲得必要的憑證吧,問題是,當我試圖共享谷歌片與我的服務帳戶的電子郵件,我收到一封電子郵件,說:與服務帳戶電子郵件共享Google工作表
Delivery to the following recipient failed permanently:
[email protected]
Technical details of permanent failure: DNS Error: Address resolution of geometric-shine-118101.iam.gserviceaccount.com. failed: Domain name not found
該電子郵件與我在.json密鑰文件中得到的完全一樣。 我在其他職位已經確認並普遍認爲應該共享電子郵件的結構是這樣的:
[email protected]
,但我的是不同的,或許它有事情做這件事? 我按照link的說明操作。
這是上傳.json密鑰文件的副本:
{
"type": "service_account",
"project_id": "geometric-shine-118101",
"private_key_id": "xxx",
"private_key": "-----BEGIN PRIVATE KEY-----\nxxx\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "117076930343404252458",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dataload%40geometric-shine-118101.iam.gserviceaccount.com"
}
做您發送電子郵件的地址,它是否工作正常。我注意到它說DNS錯誤,所以看起來像地址是無效的。 – eddyparkinson
但他是我的.json密鑰文件中的地址。我編輯我的問題添加實際的文件。 – johan855
這說明你的電子郵件格式是正確的。 http://stackoverflow.com/questions/34340150/which-email-to-use-in-google-service-account-api – eddyparkinson