Search code examples
google-plusgoogle-hangouts

how to build Hangout url?


I'm writing an add-on for hipchat. So, basically, I want:

  1. Enter in a chat room with several users (@user1, @user2, @user3, @myuser)
  2. Write the message /hangout @user1 @user3 into messages input
  3. Press enter
  4. See (as a new message) a hangout url to strat the hangout with @user1 and @user3

I don't need help to show the message (step 4), I just need to know how to build the hangout url. I need something like:

https://plus.google.com/hangouts?users[0]=user1@gmail.com&users[1]=user3@gmail.com

I know that I can start a HO accessing: http://hangouts.google.com/start But, I dont want this. I want the result url of http://hangouts.google.com/start. I want this: https://plus.google.com/hangouts/_/xxxoiiasdioasodnahsdhasd and, if it's posible with user's invitations


Solution

  • There is not a direct URL to use for starting Hangouts. Your best option is to give the user a URL on your own site that renders a Hangout Button with the people to invite specified.

    <html>
    <head>
    <script type="text/javascript">
        <title>Hangout button demo: Inviting people</title>
        <link rel="canonical" href="http://www.example.com" />
    </script>
    </head>
    <body>
        <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script>
        <g:hangout render="createhangout"
            invites="[{ id : '1234', invite_type : 'PROFILE' },
                      { id : 'foo@example.com', invite_type : 'EMAIL' }]">
        </g:hangout>
    </body>
    </html>