Discussions

Ask a Question
Back to All

Powershell and API

I'm trying to generate a token through powershell and so far - I'm getting the status code of 200 no matter what I type in.

$URL = "https://www.humanity.com/api/"

$tokenParams = @{
key = 'abcdefghigklmnop12345';
module = 'staff.login';
method = 'GET'
username = 'useraccount';
password = 'Password123'
}

Invoke-WebRequest -Uri $URL -Body $tokenParams

Response is: -
StatusCode : 200
StatusDescription : OK

Even if any of the above details are wrong