您正在使用API密鑰進行身份驗證,這意味着您只能訪問公共數據。
請求
GET https://www.googleapis.com/plus/v1/people/+lindalawton
響應
{
"kind": "plus#person",
"etag": "\"Sh4n9u6EtD24TM0RmWv7jTXojqc/8CXX3KsOcUfAF5mmrG4vyB-YNig\"",
"occupation": "Google Developer Expert, BIA Developer at Targit",
"skills": "Experience primarily in regards Microsoft products, Visual Studio, Bids, C# and asp.net. Past experience with PHP,JavaScript, MySQL and Linux. In recent years I have begun focusing on Business Intelligence, Data Warehousing, SQL Server/Analysis Services/Integration Services. Experience with OAuth2, Google Analytics API, Google Drive SDK.",
"gender": "female",
"urls": [
{
"value": "http://www.youtube.com/user/Atthena71",
"type": "otherProfile",
"label": "Linda Lawton"
},
{
"value": "http://twitter.com/LindaLawtonDK",
"type": "otherProfile",
"label": "lindalawtondk"
},
{
"value": "http://stackoverflow.com/users/1841839/daimto",
"type": "otherProfile",
"label": "Stackoverflow/StackExchange"
},
{
"value": "http://www.linkedin.com/profile/edit?trk=nav_responsive_sub_nav_edit_profile",
"type": "otherProfile",
"label": "Linkedin"
},
{
"value": "http://daimto.com/",
"type": "contributor",
"label": "Daimto - data import tutorials"
},
{
"value": "https://github.com/LindaLawton",
"type": "contributor",
"label": "GitHub - projects"
},
{
"value": "https://github.com/google/google-api-dotnet-client",
"type": "contributor",
"label": "Google APIs .Net client - GitHub"
},
{
"value": "https://github.com/LindaLawton/Google-Dotnet-Samples",
"type": "contributor",
"label": "Google APIs .Net Samples - GitHub "
},
{
"value": "https://developers.google.com/analytics/",
"type": "other",
"label": "Google Analytics"
},
{
"value": "https://developers.google.com/",
"type": "other",
"label": "Google Developers"
},
{
"value": "https://developers.google.com/experts/+LindaLawton",
"type": "other",
"label": "Google Developer Expert - Linda Lawton"
}
],
"objectType": "person",
"id": "117200475532672775346",
"displayName": "Linda Lawton",
"name": {
"familyName": "Lawton",
"givenName": "Linda"
},
"tagline": "Google Developer Expert 2014 - 2017",
"braggingRights": "Extreme Beekeeper first to recorded an Hive inspection using Google Glass with out a veil on.",
"aboutMe": "\u003cdiv\u003e\u003cb\u003eBackground\u003c/b\u003e\u003c/div\u003e\u003cdiv\u003e\u003cdiv\u003eI have been working as an application developer since 1995. I have worked with a number of database systems Oracle, Microsoft SQL Server, and MySQL. In recent years I have been mainly working with Microsoft products, Visual Studio, SSIS, and C#. I the past I worked a lot with web development PHP, JavaScript, Ajax, power-builder, Cobol and ASP.net.\u003c/div\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr /\u003e\u003c/div\u003e\u003cdiv\u003eWhile I have done front end development in the past. I find working with backed development working on automated systems fascinating. I have spent the last 5 years creating custom SSIS (Dlls), and services and APIs for the cloud (Azure).\u003c/div\u003e\u003cdiv\u003e\u003cbr /\u003e\u003c/div\u003e\u003cdiv\u003e\u003cb\u003eGoogle API Addiction\u003c/b\u003e \u003c/div\u003e\u003cdiv\u003eIn 2012 I began working with the Google APIs, starting with the Google Analytics API. I learned to appreciate the fact that Google is so open and willing to give us access to their systems. I started blogging about how to use the APIs writing short tutorials with sample projects. \u003ca href=\"http://www.daimto.com/\" rel=\"nofollow\" target=\"_blank\"\u003eDaimto - Data Import Tutorials\u003c/a\u003e. This along with my presents on a number of \u003ca href=\"http://stackoverflow.com/users/1841839/daimto\" rel=\"nofollow\" target=\"_blank\"\u003eDeveloper forms\u003c/a\u003e lead me to discovered by Google. I became one of the first \u003ca href=\"https://developers.google.com/experts/+LindaLawton\" rel=\"nofollow\" target=\"_blank\"\u003eGoogle Developer Experts for Google Analytics\u003c/a\u003e. \u003c/div\u003e\u003cdiv\u003e\u003cbr /\u003e\u003c/div\u003e\u003cdiv\u003eI also help support the \u003ca href=\"https://github.com/google/google-api-dotnet-client\" rel=\"nofollow\" target=\"_blank\"\u003eGoogle APIs client Library for .NET\u003c/a\u003e which provides simple, flexible, and powerful access to Google APIs such as Drive, YouTube, Calendar, Storage and Analytics.\u003c/div\u003e\u003cdiv\u003e\u003cbr /\u003e\u003c/div\u003e\u003cdiv\u003e\u003cb\u003eLife\u003c/b\u003e\u003c/div\u003e\u003cdiv\u003eI grew up in a small town in \u003ca href=\"http://en.wikipedia.org/wiki/Dartmouth,_Massachusetts\" rel=\"nofollow\" target=\"_blank\"\u003eMassachusetts\u003c/a\u003e, USA, I moved to \u003ca href=\"http://en.wikipedia.org/wiki/Denmark\" rel=\"nofollow\" target=\"_blank\"\u003eDenmark \u003c/a\u003ein 1998 and have lived here since. I have a 22 year old daughter. My hobbies include reading science fiction, painting, and gardening. \u003c/div\u003e",
"url": "https://plus.google.com/+LindaLawton",
"image": {
"url": "https://lh5.googleusercontent.com/-a1CWlFnA5xE/AAAAAAAAAAI/AAAAAAAAdVM/sHkU9F-AwwQ/photo.jpg?sz=50",
"isDefault": false
},
"organizations": [
{
"name": "Newberry College",
"title": "computer science",
"type": "school",
"startDate": "1991",
"endDate": "1994",
"primary": false
},
{
"name": "TARGIT",
"title": "Business Intelligence Developer",
"type": "work",
"startDate": "2011",
"primary": true
},
{
"name": "Logimatic",
"title": "developer",
"type": "work",
"startDate": "2008",
"endDate": "2010",
"primary": false
}
],
"placesLived": [
{
"value": "Aalborg Denmark",
"primary": true
},
{
"value": "Marathon Florida"
},
{
"value": "Dartmouth Massachusetts"
},
{
"value": "Ashford Connecticut"
},
{
"value": "Nykøbing Mors Denmark"
}
],
"isPlusUser": true,
"circledByCount": 2006,
"verified": false,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "https://lh3.googleusercontent.com/t2ViXd7ar3MeiOCeTe2g86Qd7wOnbRvuf3eTW3LPrs8jwBJwKS6gsC4KWhvbRSytJ5fsDne3sw=s630-fcrop64=1,00000000ffffffff",
"height": 528,
"width": 940
},
"coverInfo": {
"topImageOffset": 0,
"leftImageOffset": 0
}
}
}
只會返回什麼說用戶已設置爲公開。如果他們的電子郵件不公開,您將無法看到它。
謝謝你的快速和完整的答案!請告訴我,即使不公開,我如何獲得用戶的電子郵件地址?我應該用包含clientID和clientSecret的對象替換API KEY嗎?如果肯定,我下一步應該做什麼? –
據我所知,如果他們沒有將其設置爲公開,則無法獲取某人的電子郵件地址。谷歌沒有電子郵件地址API,這在很多方面都不好。 – DaImTo
根據以下文檔:https://developers.google.com/identity/protocols/OAuth2,說:'在應用程序可以使用Google API訪問私人數據之前...',如果使用OAuth,我可以訪問私人數據。所以,我想我必須改變我的代碼。謝謝!如果您使用Google登錄嘗試查看電子郵件範圍,則爲 –