[英]Google Drive & Spreadsheets API: Get the user's email address
我正在使用Google Drive and Spreadsheets API(僅適用於javascript / jquery)開發一個簡單的CRUD網站,因此有權訪問該文件的用戶可以在電子表格中添加或更改某些條目。 一切都完成了,但是現在我需要獲取用戶的電子郵件地址,這樣我才能確定誰在進行更改。 關於如何獲取該數據的任何想法嗎?
我剛剛找到了使用Google+ API的解決方案...這里是:
function getEmail(){
gapi.client.load('plus','v1', function(){
var request = gapi.client.plus.people.get({
'userId': 'me'
});
request.execute(function(resp) {
console.log(resp.emails[0].value);
});
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.