Closed JRAndreassen closed 3 years ago
There isn't any required libraries.
Call-ZenDesk
is a procedural function inside the code, it doesn't pull in third-party stuff.
Call-ZenDesk (earlier in the code):
# call the zendesk api
function Call-ZenDesk($Api, $Method, $Body) {
# by default, powershell seems to want to use insecure/deprecated tls, the following fixes that
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Method $Method -Uri "$($BaseUri)$($Api)" -Headers $AuthHeader -Body $Body
}
Call-ZenDesk = triggers the function call $Api = /api/v2/tickets.json $Body is pulled from a variable earlier in the code that digests the message body and puts it in json format:
$Body = ConvertTo-Json($Transaction)
You don't "install" it like a NPM app, you copy the script into PRTG and inform the script of your API details: https://github.com/angela-d/prtg-zendesk-webhook#how-to-use-it
"The first thing you go blind on are the eyes"
Thanks... JR
:) Hope it's useful for you!
Please update the README.MD with the required libraries. Preferably with links / statements to install.
In particular: "Call-ZenDesk "/api/v2/tickets.json" Post $Body"
Where is "Call-ZenDesk" Thanks JR