Search code examples
google-hangoutshangouts-api

API to make public Google Hangout Url


I have a private web page. I want to offer a Google Hangout link from that page.

Anyone with the link is "authorized" to use the Hangout. I'd prefer they don't have to log in (it's fine if they already are). It's extra work and opportunity for fail.

How can I make a public Google Hangout link? A way for two people to rendezvous? Where I can pass a roomId. I looked at the Hangouts API and didn't see how to add this.

Hangout URL's have 135 bits, so that seemed random enough to be secure. I wrote this function, but it mostly didn't work, and when it did the hangouts were not public.

  newHangoutsUrl: function() {
    /* Hangout urls can be made on the fly:
     *     https://plus.google.com/hangouts/_/{roomId}
     *
     * Where roomId = 27 random chars from set '234567abcdefghijklmnopqrstuvwxyz'
     *
     * this is called on client so we use Math.random();
     */
    var set = '234567abcdefghijklmnopqrstuvwxyz'.split('');
    var ret = '';
    for (var i=0; i<27; i++) {
      ret += set[Math.floor(Math.random()*set.length)];
    }
    return 'https://plus.google.com/hangouts/_/' + ret;
  },

Any suggestions?


Solution

  • You probably should just use the Hangout Button from your page as there is not a way to programmatically generate / use hangout URLs. You can use Invites to add people to the hangout.