Create a direct link to open a conversation with a user at chat.google.com - hangouts-chat

I have a list of contacts on my site, each of whom has a valid google account / email address. I want to create a link for each person which, when clicked, will take the user to chat.google.com (not hangouts) and open a conversation with that person.
Looking at the URLs which appear when I open conversations with users in the Google Hangouts chat web app, the format seems to be the following:
https://chat.google.com/u/1/dm/
Is there a way of retrieving this user id for a given google user?
If this is possible, will a link of constructed in this way solve the issue, or is there more to consider?
Many thanks in advance.

Related

Direct link to Google Chat DM

I'm unable to generate a direct link to Google Chat DM. We'd like to link Google Chat DMs to peoples profiles in our organisation.
I've tried to use the users Google ID to generate the link, for example https://chat.google.com/dm/123455 but that redirects nowhere.
I'd expect that there is a way to generate a direct link, either by using users primary email, google ID or to list users DMs through an API call.
Retrieving the "user chat ID" does not seems possible with the existing API.
I have created a new feature request, for the Google Hangouts Chat API (or People API for that matter), to expose this information : https://issuetracker.google.com/issues/134526655
As a workaround, you can use the People API to retrieve the Gaia ID of a user, and then open the a Google Hangouts conversation with the appropriate URL.
Quoting my answer to "Create direct link to Google Hangouts chat" :
you'll need to know that person's Gaia ID (an internal ID used by Google).
I have added a detailed answer to an existing stackoverflow question in which I describe how to retrieve the Gaia ID using the People API.
TL;DR: Request metadata in the personFields, by using people.connections.list resources for your contacts, or the people/get resource for yourself.
Once you've got someone's Gaia ID, it's pretty straightforward to create the correct URL to start a Hangout with them. Simply replace 1XXXXXXXXXXXX below with that user's Gaia ID:
https://hangouts.google.com/chat/person/1XXXXXXXXXXXX

Hangouts Chat - Send link to add bot to space

I am building a Google Hangouts Chat chatbot.
I need my bot to prompt users, following a dialog with another user. However, a conversation may not have been started with these users yet and I do not have permission to start one without being added to a DM space.
The current solution I envision is to prompt users by email. However, I cannot find a direct link to the bot, or that adds the bot to the user's space. Does such a link exist? Or do I have to send an email with instructions such as "Please go to chat.google.com and add the bot to a conversation"? I'm afraid this will generate strong churn.
Thank you.
Bots can only be added to a space by a user so yes, you will need to instruct the user to add them manually

Is it possible to send website invitee to google plus users

Is it possible to send website invitee to google plus users.
I have a website with option to login using google account. I want to send an message to all friends of logged in google users on logged in users request.
I think interactive posts would be a good solution for this.
This allows users to choose themselves who and if they want to invite.
You can define an invite text that will be prefilled in the share box (even though users can adjust that text).
If you want you can also use the people.list method to fetch some of the more relevant friends and prefill the share box with them.
See https://developers.google.com/+/features/interactive-posts and https://developers.google.com/+/web/share/interactive for details.

Services that get facebook emails

I've noticed that my android phone, the iphone, outlook.com, and yahoo mail all can import my friends' email addresses (and sometimes phone numbers) from facebook. However, I don't see anywhere in the documentation of the API to suggest that you can get email.
Do these services have special agreements with Facebook or am I just not finding the specific api for "contact" importing? I've not had any luck using "email" field with friends api.
Any ideas?
These services have some special agreements with Facebook and thus are able to retrieve the Email Ids of the Friends of the User. Most of them don't allow further exporting of data obtained from there directly.
And as per Email Permissions documentation here it clearly states that for App Developers
Note: There is no way for apps to obtain email addresses for a user's friends.
As per the phone number, there is no access to it no matter what permission. You may though ask the user to fill those for you.

How can I allow users on my website to invite friends from the Google Contacts?

I'm looking for a similar option that exist in Facebook (http://developers.facebook.com/docs/reference/plugins/send/) But for google.
Something like a button that allows people to view a list of their gmail contacts and select some of them and send them a message.
I've found friendconnect, which does something similar, but not exactly it. In any case friendconnect will be discontinued on March 1st.
Any ideas?
Your application should probably take care of sending the messages, but if you want to get which contacts a user has, there is an API for it (http://code.google.com/apis/contacts/).
This will of course require the user to trust your site enough to authorize this data exchange.
You should consider requesting this access using OAuth. There is some information about this here (http://code.google.com/apis/contacts/docs/3.0/developers_guide.html#Auth).