Jan Petr
Jan Petr

Reputation: 705

How to create Hangouts chat message via API with a link to Video meeting

I'm trying to create Google Hangouts Chat message with a link to new Video meeting.

So far I managed to send a regular message, but I cannot find how to create a video meeting and send a link there:

msg := chat.Message {
    Text: "test msg",
}

_, err := chatService.Spaces.Messages.Create(spaceID, &msg).Do()
if err != nil {
    log.Fatal(err)
}

In the chat itself it's easily doable: enter image description here

Any help will be appreciated! Thanks!

Upvotes: 0

Views: 1923

Answers (1)

Iamblichus
Iamblichus

Reputation: 19309

You have several options:

If you include a plain link URL in your message text, such as http://example.com/foo, Hangouts Chat uses this as the link text and automatically hyperlinks that text to the specified URL.

If you don't want the link URL to show up, you can provide an alternate link text for this link, using the following syntax:

<video-meeting-url|your link text>
  • You can also customize your message to a higher degree by sending a card message. You can for example, provide a custom image for the meeting link, as explained here.

UPDATE:

Before doing this, you have to create a video meeting and get its link. You cannot create a video meeting with Hangouts Chat API.

As you can see in the official documentation, Chat API can only be used to manage spaces (that is, chat rooms and direct messages), as well as its members and messages. Video meetings are not part of Hangouts Chat but of Hangouts Meet, and there is no open Hangouts Meet API.

Reference:

Upvotes: 1

Related Questions