Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $InsightServerUrl = "Your Site URL Here"
- $Username = "Your Case Sensitive Username"
- $Password = "Your API KEY Here"
- # Encode Creds
- $auth = $Username + ':' + $Password
- $Encoded = [System.Text.Encoding]::UTF8.GetBytes($auth)
- $authorizationInfo = [System.Convert]::ToBase64String($Encoded)
- # Set headers with ExperimentalApi
- $Headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
- $Headers.Add('content-type' , 'application/json')
- $Headers.Add('Authorization', 'Basic ' + $authorizationInfo)
- $Headers.Add('X-ExperimentalApi', 'opt-in')
- # Call the URI
- $Request = [System.UriBuilder]"$InsightServerUrl/rest/servicedeskapi/insight/workspace"
- $response = Invoke-RestMethod -Uri $Request.Uri -Headers $headers -Method GET
- $response.values.workspaceId
Add Comment
Please, Sign In to add comment