Forum Discussion

twendlingats's avatar
2 years ago

Google Workspace Webhooks

Hello, the organization that I am working with as a contractor is deep into Google Workspace for all chat. Has anyone successfully sent webhook alerts to a space?

  • Regardless of the method I am getting the following error:

     

    {
    "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unexpected token.\ntype=alert&status=te\n^",
    "status": "INVALID_ARGUMENT"
    }
    }
  • Anonymous's avatar
    Anonymous

    What does the payload of your integration look like?

  • From the information available, it would appear the issue here is that alert metadata is being passed as JSON tokens, which aren’t natively recognized by Google. Instead it would likely need to be passed as the value of one or more widgets per Google’s card message structure. 

  • Anonymous's avatar
    Anonymous

    In the docs it looks like I can write my own JSON to deliver and use the variables?

    Yep, you just need to specify the JSON you want to send in your payload. You can insert any token from the alert into the JSON. What you can’t do is gracefully handle null values or missing tokens (because of different alert types). 

    Have you mocked up the POST in postman? That would let you get the JSON payload fine tuned and working, then you can move that into LM and replace the values with tokens.