Direct link to Google Chat DM - hangouts-chat

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

Related

Using Instagram's Graph API, how can I retrieve post data (media url, caption, poster username, etc)

I want to use Instagram's Graph API on my backend server to retrieve data about an Instagram post. On my frontend, users will submit a post URL (like https://www.instagram.com/p/CAvPIm2lszQ/). Then on my backend, I want to take the ID of the post from that URL (so in this case CAvPIm2lszQ) and then I'm hoping that I can pass that ID thru the Instagram Graph API and then retrieve the data that I need (media URL, caption, poster username, etc.).
So would that be possible? I did find documentation on "IG Media" for the Graph API, but under permissions, it says, "A Facebook User access token from a User who created the IG Media object, with the following permissions.."
Unless I'm misunderstanding it, I'm not sure if I'll be able to access posts from various public accounts. I think it's also worth mentioning that my users are not logging into their Instagram accounts to use my service so the only possible "User access token" would be my own.
Any ideas on how I can go about this? I was using the instagram.com/p/{post_id}/?__a=1 endpoint to meet my needs before but it doesn't work on my production server for some reason. So I'm kinda stuck.
Most probably you will not be able to achieve that using Instagram API. First of all the ID you are referring to CAvPIm2lszQ is not the ID that you will use for getting IG Media. The ID is different (it's numeric value like in the sample request from the page you've linked). The full URL that includes CAvPIm2lszQ is in the shortcode field.
At the moment it is not possible to look for the post detail using shortcode. If you want to use that endpoint you need to get the real post ID first, for instance by listing list of posts from given user.
But in order to do so - you need to use Facebook login authorization window to get token from given user. Alternatively you can try to request https://developers.facebook.com/docs/instagram-api/guides/business-discovery but it requires going through App review and having your own company to pass the Business Verification. Keep in mind that this endpoint returns information only about Instagram Professional accounts (Business/Creator account). You will not be able to get information about regular accounts.
And the last thing about ?__a=1 endpoint. This is not the official Instagram API. They use it only for their own purposes. Most probably your server IP address has been blocked due to sending too many requests.

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

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.

After Google+ People API list endpoint is deprecated. It is possible to get the visible friends list in circle?

Using "https://www.googleapis.com/auth/plus.login" api, we are getting the access to a list of people in the user's circles in addition to their name and profile information. After api deprecation, we using people.connections.list api "https://people.googleapis.com/v1/people/me/connections" as per documentation but we get list contacts only, not friends list in google+. please help us to retrieve the friends list in google-plus. Thank you
This is probably only telling you what you already know or have guessed.
From the deprecated People API page: "... calls to the API return empty circle data for those new sign-ins." and "In place of the social connection data from the Google+ People API, you can get rich contacts data from the new Google People API."
It seems that there will no longer be a public API for getting a Google+ friends list. Consider supporting an alternate social media platform for your app or utilizing Google Contacts.
It sounds like the People API will actually be more powerful than the G+ people.list method. The G+ API only listed people that the user had circled--that isn't the same as being a friend or close contact. The people API likely better reflects closer connections between individuals as well as exposing a broad number of contacts to apps. I think for most apps, this is an improvement.

Reverse lookup of a phone number on Google+ (number -> name mapping)

Android Kitkat has a new smart callerid feature which I believe looks up the incoming phone call against your google+ contacts and also against google+ business pages / google business listings. It's pretty smart and would be a good way to lookup phone numbers in general.
I've looked through the google+ API documentation and had a hunt for any other APIs, but I can't immediately see a way to do this via the google+ API (or even on the google+ website or main google website) - does anyone know if it's possible?
The Contacts API might be your best bet, you can map contacts to Google+ IDs by looking at the profile URLs for a given contact. While people can add phone numbers to their Google+ profiles, the Google+ API in the Person resource does not expose that information even if it is public.

Is there any way I can retrieve twitter user's email Id (Objective-c)?

https://dev.twitter.com/docs/faq#6718
If twitter doesn't provide any API, then how does foursquare retrieve them?
Foursquare has provision to list out the user's foursquare-friends who have registered with twitter.
It also provides API which shows friends of users who commonly appear in 'foursquare friend's list' as well as 'twitter followers list' of the user.
In both the above cases comparison can be made only through email.
Please help.
There's no way for you to get an e-mail from Twitter. Except, of course, by asking the person to give it.
What FourSquare does need no access to the e-mail. Matching is based on the Twitter name, not on the e-mail.
In the comments you say
My friend has registered in both Twitter and Foursquare. The only field common in her profile is the email id. No other fields match. She comes in the 2nd list which i have mentioned above.
but then you admit
After she has registered with FourSquare, went to her profile, clicked on friends -> Add Friends -> opted Twitter. She was asked to login to Twitter and thus she did it
This means that now FourSquare have access to her Twitter as well as your. Foursquare knows her Twitter id and your twitter id and can access Twitter (using Twitter API) to see who is following is following who. In other words when you say
The only field common in her profile is the email id. No other fields match.
You are wrong. Once she connected her FourSquare profile with her Twitter, all data that is accessible via Twitter API is in fact (at least potentially) part of her Foursquare profile.
But she needed to explicitly connect the two profiles (which she did when she opted to add friends to her Foursquare profile using Twitter).