Access Google+ Data in Google Contacts - google-apps-script

If a contact has a public Google+ profile and this data appears in your Google Contacts, is it possible to access that data via Google Apps Script? If so, how?
For example, I add a contact with only a full name and an email address. That contact has a public Google+ profile that includes a phone number. Their phone number will show up in my Google Contacts (including a search from Google Contacts) but the following code will not return their phone number:
var contacts = ContactsApp.getContacts();
for (i in contacts) {
phones = contacts[i].getPhones();
for (j in phones) {
Logger.log(phones[j].getPhoneNumber());
}
}
How do I access the Google+ phone number via Google Apps Script?

It is not possible to retrieve this information. At least, not directly via Google Apps Script Contacts Services.
I also think that this should be possible. Please open an enhancement request on Apps Script issue tracker.

Related

How can my Slack Bot that uses Google APIs to generate a Google Sheet with data for users using a Service account add a Script to that sheet

I have a private Slack Bot that uses Google APIs to generate a Google Sheet with data for our users. I am using a Service account as the bot creates those sheets under it's own Google account.
Now I want to add a script to that sheet (so that users can upload the modified data back into the server) using the Google Script API.
How can I do this? What are the workarounds?

How to get user's location at the hangouts chat bot using apps script

I created a hangouts chat bot using apps script. I would like to access user's geographical location.
For example, when a user connects to the bot, the bot should greet the user with the user's location, such as longitude, latitude. I assume the users are using hangouts-chat in chrome browser. I am not sure whether this is even possible since the bot is at google's server side hosting the apps script code.
function onMessage(event) {
var msg = event.message;
var input = event.message.text;
var name = event.user.displayName;;
// code here to tell user's location
return {"text":"your location is:"+sth};
}

How to get "Inbox by Google"-reminders via a Google App Script?

Is it possible to get all Inbox by Google reminders via Google App Script?
I can't find any reference for accessing Google Inbox stuff. Mail data is covered with Gmail API, but no information about new Inbox by Google features, like the reminders.
I would like to make a printable sheet from all undone reminders/tasks.

In google app script how google is choosing the account in which the doc must be created

I am creating a google app script which will create a google doc in user's drive.
In case, when a user is signed in to google using multiple account, how does app script determines which account it is being accessed from.
Thanks for the help.
Session.getActiveUser().getEmail()
This won't work if the user is signed in with a gmail account though.
https://developers.google.com/apps-script/reference/base/user

How to invoke a gmail service from google site

I read the tutorial, https://developers.google.com/apps-script/articles/building-sites-app-part2 that uses spreadsheet service in Google sites. The code uses the spreadsheet key. However to access my mail should I use Oauth or something like,
var email = String(Session.getUser().getUserLoginId());
Can we also use minute trigger when we embed GAS in google sites?
Your question is not clear. What do you want to do ? Do you want to get the email ID of the user or do you want to access your email.
Session.getUser().getUserLoginId() only returns the login id of the logged in user. And it works only in Google Apps accounts (not consumer accounts).
If you want to access your email, then make use of the Gmail service