Forum Discussion

Joe_Williams's avatar
6 years ago
Solved

HTTP Authentication Required?

I have two sets of code. 1 pulls all 'Services' or Website groups. The other is supposed to just pull the group name and id. The first works, the second doesn't. I am using the base PowerShell scri...
  • Joe_Williams's avatar
    6 years ago

    The documentation isn't correct it appears in some areas.

    $httpVerb = 'GET'
    $resourcePath = '/setting/collectors'
    $queryParams = '?fields=id,description,hostname'
    
    $data = ''
    $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath + $queryParams
    
    <# Concatenate Request Details #>
    $requestVars = $httpVerb + $epoch + $data + $resourcePath

    I had to add a blank data variable. Once I did that everything worked. I found that string via the Python code.