Getting Google Contacts
-
I am looking at this Google API WPF OAuth Example[^] I understand most of what it's doing. In userinfoCall() it displays the Google user's info
Making API Call to Userinfo...
{
"sub": "",
"name": "Kevin Marois",
"given_name": "Kevin",
"family_name": "Marois",
"locale": "en"
}What I need is to get the user's contacts. I've been searching & playing with this all day but I can't figure out how to do this.
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
I was right:
How Sign in with Google helps you share data safely - Google Account Help[^]
What data Google shares Important: Sign in with Google doesn’t share your Google Account password. When you use Sign in with Google to access a third-party app or service, Google only shares the following information associated with your Google Account: Your name Your email address Your profile picture This data is only shared after you give permission. If you want to use Sign in with Google, you can't exclude any of these pieces of data. In addition to your name, email address, and profile picture, the third party might request further access to some of your Google Account data.
You might be able to get contact access if you asked for it when you tried to use OAuth as a added permission, but even that's dodgy with GDPR as it includes other people's personal info so technically you might need permission from each individual in my contacts in order to get them. :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
I am looking at this Google API WPF OAuth Example[^] I understand most of what it's doing. In userinfoCall() it displays the Google user's info
Making API Call to Userinfo...
{
"sub": "",
"name": "Kevin Marois",
"given_name": "Kevin",
"family_name": "Marois",
"locale": "en"
}What I need is to get the user's contacts. I've been searching & playing with this all day but I can't figure out how to do this.
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
Yeah ... "contacts" are "personal" information; just what your spammer / hacker is looking for.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Maybe this is what you need to look at: Read and Manage Contacts | People API | Google for Developers[^]
Certainly looks like that should answer the OPs question. As a side note looking at that very quickly I didn't see any mention of what happens if the reader doesn't have permission to view those. Seems like that would be a very relevant error case. Certainly something that a developer should test.
-
Certainly looks like that should answer the OPs question. As a side note looking at that very quickly I didn't see any mention of what happens if the reader doesn't have permission to view those. Seems like that would be a very relevant error case. Certainly something that a developer should test.
-
I very much doubt if you can: I'd class my contacts list as "personal information" and I'd be pretty unhappy if any site I logged into using Google had access to them or my calendar. There is also GDPR which would almost certainly apply, and Google isn't going to ignore that!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
You, as the user, authorize it via an OAuth window. We already had this functionality in out app, then Google changed their Auth process. I'm just trying to upddate the app See this[^] I just can't figure out how to integrate that into their sample code
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
-
Maybe this is what you need to look at: Read and Manage Contacts | People API | Google for Developers[^]
I saw that already. I can't figure out how to integrate that first bit into their sample
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
-
I saw that already. I can't figure out how to integrate that first bit into their sample
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
I'm afraid that using the Google API's is not the easiest thing in the world, IMHO. You need to follow the link to the setup section and start there. It's a good few years since I set up my account (which has since been deleted) so i'm afraid I can't offer any insights.
-
I'm afraid that using the Google API's is not the easiest thing in the world, IMHO. You need to follow the link to the setup section and start there. It's a good few years since I set up my account (which has since been deleted) so i'm afraid I can't offer any insights.
OK, thanks anyway
In theory, theory and practice are the same. But in practice, they never are.” If it's not broken, fix it until it is. Everything makes sense in someone's mind.
-
I'm afraid that using the Google API's is not the easiest thing in the world, IMHO. You need to follow the link to the setup section and start there. It's a good few years since I set up my account (which has since been deleted) so i'm afraid I can't offer any insights.
Just curious - have you used any non trivial API ever that was easy? Perhaps not just initially but including support? Myself I was used 'bitly' which seemed pretty easy except that they throttled using a HTTP 500 error with no other error message. So no way to know if there was a problem on their end or if one had just reached the throttle limit. Noting of course that HTTP 429 exists for exactly this reason.
-
Just curious - have you used any non trivial API ever that was easy? Perhaps not just initially but including support? Myself I was used 'bitly' which seemed pretty easy except that they throttled using a HTTP 500 error with no other error message. So no way to know if there was a problem on their end or if one had just reached the throttle limit. Noting of course that HTTP 429 exists for exactly this reason.