We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I found a tutorial article in the site internet for a delegate credential .
Here, I don't know the language in PHP. Is there a way to convert from this language to google script (GAS) or javascript ? otherwise how to do it?
Here is the small function in php (?) below
/----
from googleapiclient import discovery from httplib2 import Http from oauth2client import file, client, tools from google.oauth2 import service_account
SCOPES = ['https://www.googleapis.com/auth/gmail.settings.basic'] SERVICE_ACCOUNT_FILE = 'the-downloaded-keyfile.json'
// # The user we want to "impersonate" USER_EMAIL = "[email protected]"
credentials = service_account.Credentials. from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES) delegated_credentials = credentials.with_subject(USER_EMAIL)
service = discovery.build('gmail', 'v1', credentials=delegated_credentials)
send_as_addresses = service.users().settings().sendAs(). list(userId=USER_EMAIL, fields="sendAs(isPrimary,sendAsEmail)")
addresses = send_as_addresses.execute().get("sendAs", [])
The text was updated successfully, but these errors were encountered:
This sample code is Python (not PHP).
I'm going to route this to the Javascript repository so this can receive help from someone familiar with javascript.
Sorry, something went wrong.
This sample should help:
No branches or pull requests
I found a tutorial article in the site internet for a delegate credential .
Here, I don't know the language in PHP. Is there a way to convert from this language to google script (GAS) or javascript ? otherwise how to do it?
Here is the small function in php (?) below
/----
from googleapiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
from google.oauth2 import service_account
SCOPES = ['https://www.googleapis.com/auth/gmail.settings.basic']
SERVICE_ACCOUNT_FILE = 'the-downloaded-keyfile.json'
// # The user we want to "impersonate"
USER_EMAIL = "[email protected]"
credentials = service_account.Credentials.
from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES)
delegated_credentials = credentials.with_subject(USER_EMAIL)
service = discovery.build('gmail', 'v1', credentials=delegated_credentials)
send_as_addresses = service.users().settings().sendAs().
list(userId=USER_EMAIL, fields="sendAs(isPrimary,sendAsEmail)")
addresses = send_as_addresses.execute().get("sendAs", [])
/----
The text was updated successfully, but these errors were encountered: