Tautulli notifications to Google Chat

This was suprisingly difficult for me to get working initially, though that was just my not understanding webhooks in Google Chat.

Originally i assumed chat would just accept POST’s to the webhook URL and then it would post in the channel. But because Chat allows you to make some pretty nice “Cards” (Posts that display the data) you do need to provide quite a lot of additional data in a format Chat expects.

Once i had worked out the formatting, i was able to send some nice looking Cards to my “Plex – Latest Releases” room.

Here is an example of my POST:

{
    "cards": [
      {
        "header": {
            "title": "Plex New Releases",
            "subtitle": "plexbot!",
            "imageUrl": "http URL for a logo -",
            "imageStyle": "AVATAR"
          },    
        "sections": [
          {
            "widgets": [
                {
                    "keyValue": {
                      "topLabel": "Just Added:",
                      "content": "{title} {season_num} {episode_num}"
                      }
                  },    
              {
                "image": { "imageUrl": "{poster_url}" }
              }
            ]
          }
        ]
      }
    ]
  }

This will go in the data section for “Recently Added”.

And here is what the “Cards” look like: