Trying to use powershell to pull pull information from samanage but I keep getting an error when just testing the authentication part documented here
Below is the code I am running with my token removed.
$token = 'TOKEN'
$apiver = 'Accept: application/vnd.samanage.v2.1+json'
$apiurl = 'https://api.samanage.com/'
curl -H 'X-Samanage-Authorization: Bearer $token' -H $apiver -H 'Content-Type: application/json' -X GET $apiurl + incidents.json
And then here is the error I get:
EDIT: I did some google searching for the error and everything i found basically said to do it differently but none of it was related to SWSD.
Give this a try instead:
$token = 'TOKEN'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", 'application/vnd.samanage.v2.1+xml')
$headers.Add("X-Samanage-Authorization", "Bearer $token")
$apiurl = 'https://api.samanage.com/'
curl -H $headers -X GET $apiurl + incidents.json
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.