Google Ads API - get customerId from e-mail address - php

I am trying to create a web application (backend is in PHP / Laravel), with this functionality
user ads a valid gmail address
system checks if the address is valid and if such a address is assigned to a Google Ads Account
if true, system should "somehow" retrieve the customerId of the google ads account, or all of them if there are more than one accessible from the address
system checks if the ads account is an MCC account
step
if so, system should list all of the customers the mcc account is "handling"
...
My question is - how do I do step 3?
The "input" data I have is the e-mail address, at this point I already know that it's valid, and the account has already given permission to my application to access google ads, I have everything properly configured, but
I have no clue HOW to do it. The official API documentation is not very helpful, just like the official PHP library which I'm using, it assumes that I KNOW the customerId (or the loginCustomerId in the case of MCC accounts).
Any clue how could I do it?

Related

Google account ID by account email

I'm writing an application for limited amount of users and logging to app is designed only via google accounts. Now I need to add functionality of adding permissions of accessing app based on email address. Problem is, on the database level, verification of permission to access app is based on Google ID. Since Google ID is more of less not a secret information, is there a way how to get Google ID of account based on email address, without actually logging in with this account?

Pull a user's Google+ or Gmail list of contacts and their email addresses

I'm building an app in which I'm trying to allow a user to log in through Google+ (currently using the Google API PHP Client Library) and pull their entire contact list in to decide if they want to send an email to their list from my app. I can easily see how to allow the user to grant access to multiple permissions through different Google APIs through setting scopes.
I'm struggling to see either what scope I should be setting when making a request and/or what API should accomplish pulling a logged in user's contact list along with each contact's email address.
Any help would be greatly appreciated.
I found the answer, you have to pull contacts with an valid OAuth request through the Google Contacts API. On the documentation page for the Google Contacts API, Google says:
The Google Contacts API allows client applications to view and update a user's contacts. Contacts are stored in the user's Google Account; most Google services have access to the contact list.
You can find the documentation here.
https://developers.google.com/google-apps/contacts/v3/

Google Calendar API ACL Rule Not Sending Invitation to Non-Google Email Address

We're looking for some specific expertise with respect to sharing access to Google Calendar accounts via the Google Calendar v3 API. Once the calendar is created, we are creating ACL rules to allow access by other email addresses. Our problem lies in having the auto-generated invitation sent to non-Google email addresses. Unlike a Gmail address, which automatically gets the calendar added to the Gmail address' calendar, we've found that if the email address has not been previously linked to a Google account, it does not automatically receive an invite from Google to the Calendar as it would if the the address was shared manually via the web browser interface. We are able to manually have the invitation sent out by manually deleting the API created ACL rule from the calendar's share list and then manually adding the email address again, which prompts to send the invitation. Naturally, we want that invitation sent automatically when the ACL rule is added by the API.
Note, this has nothing to do with sending event notifications. This is for access to view the calendar itself.
Is there anyone with some relevant experience that can enlighten us on this behaviour?

How to get developerToken for google adwords api?

I've downloaded the PHP client library for Google Adwords API. I need to insert my login details in /src/Google/Api/Ads/AdWords/auth.ini. One of the variable is developerToken.
How can I get it?
Directly from the API...
Your assigned Developer Token will be activated once your application
for API access is approved. Your token will be available through your
AdWords API Center—accessible through the My Account menu for the MCC
account you applied with. You'll be able to access the API by
including it in your request headers when interacting with our system.
It is very important that you keep your Contact Email up to date—we
may send you important information regarding disruptions to service
and urgent changes via this channel.
https://developers.google.com/adwords/api/docs/signingup
I understand this might be old, but since Google updated their API, let me share my experience.
You need to create an MCC account (My Client Center), basically if you already have a Google Adwords account you cannot use it to generate developerToken however, you still can you use same Gmail account to create a new MCC account.
Follow below:
https://adwords.google.com/home/tools/manager-accounts/
Click on Start Now
Probably you are already logged in using your Gmail account, in all cases use your Gmail account in the email address field.
Choose name for your account let's say main-account
Do not click save and continue
Check below picture, you need to click, click here in the message below.
You will then redirect to the main dashboard, where you can click on Tools and then under SETUP tab you will find Adwords API Centre where you will be able to generate developerToken
you have to use the developer token from your live account. The token will work fine even if its status is pending

Google Account Information with oauth

I am develop a application that allow login from other applications, eg. Google, Facebook, linkedin, etc.
My question is, howto obtain the user account information from google, after login with oauth.
With user account information, i mean: name, email, date of birth, etc.
Thanks.
If you're talking about Google Apps, there's a lot of info on the APIs on Google Code: http://code.google.com/googleapps/docs/#auth
If you're just using Open ID with Google Accounts, I believe you can only get name + email address. There's some info (including code samples) in the Google Apps Marketplace docs: http://code.google.com/googleapps/marketplace/tutorial_php.html#Integrate-OpenID

Categories