Forum Discussion

Joe_Williams's avatar
Joe_Williams
Icon for Professor rankProfessor
7 years ago

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
    7 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.