Question

Generating a webhook out of assyst

  • 6 September 2022
  • 2 replies
  • 213 views

Userlevel 3
Badge +8

Does anyone here utilize a webhook?

I cannot find anything in the wiki relative to being able to do so.  Any help? We have a POC from a vendor and they are asking us to deliver a json payload via webhook from assyst for a simple demo and I’m struggling to find a way to make that happen.

Thanks!


2 replies

Userlevel 4
Badge +12

We are early on in our journey in this area too  but have had some success triggering PowerShell based scripts from the Action Processor. Using Invoke-RestMethod and Invoke-WebRequest to trigger an Azure Hybrid worker runbook for some basic operational tasks.

Edit - also dawned on me that we have some MS Teams webhooks receiving monitoring notifications.

 

Function Invoke-TeamsAlert {

    [CmdletBinding()]

    Param(

        [Parameter(Mandatory = $true)][String]$Uri,

        [Parameter(Mandatory = $true)][String]$Title,

        [Parameter(Mandatory = $true)][String]$Text

    )

   Process {

        [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

        $JSONBody = [PSCustomObject][Ordered]@{

            "@type"      = "MessageCard"

            "@context"   = "http://schema.org/extensions"

            "summary"    = "$Title"

            "themeColor" = 'FF0000'

            "title"      = "$Title"

            "text"       = "$Text"

        }

        $TeamMessageBody = ConvertTo-Json $JSONBody -Depth 100

 

        $Params = @{

            "URI" = $Uri

            "Method" =  'POST'

            "ContentType" = 'application/json'

            "Body" = $TeamMessageBody

        }

        Invoke-RestMethod @Params

    }

}

 

 

Userlevel 3
Badge +11

Hi Mitch, 

As discussed lasted night I’ve asked our development team and the two suggestions they had were to either

  1. Use destinations to push information onto the message bus and then “read” those messages with something else to do the processing your require (for example IPAAS)
  2. Use the action processor in a similar way to what Steve has explained above. 

Destinations are quite an advanced topic however there is a bunch of information available on the wiki to help you with setting them up and using them.

https://wiki.axiossystems.com/assyst11-5Wiki/index.php/Integrations:External_Messaging_System_-_Background

https://wiki.axiossystems.com/assyst11-5Wiki/index.php/Integrations:External_Messaging_System_-_Writing_An_Integration_Client

Hope this helps, 
Cheers,
Robert

Reply