Whois

PAID
By enclout | Updated hace 21 días | Other
Health Check

N/A

Back to All Discussions

401 Unauthorized

Rapid account: Pcgeek 86
pcgeek86
hace 10 años

All I get with this service is a “401 Unauthorized.” I’ve defined an auth_token and included that in the query string.

#$ApiKey = 'TESTAPIKEY'; # Redacted
$ApiKey = 'PRODUCTIONAPIKEY'; # Redacted
$AuthToken = 'AUTHTOKEN'; # Redacted
$Headers = @{ 'X-Mashape-Authorization' = $ApiKey; };

$Uri = '{0}?auth_token={1}&url={2}' -f $ServiceRoot, $AuthToken, 'google.com';

$Result = Invoke-RestMethod -Method Get -Uri $Uri -Headers $Headers -Verbose;
Write-Output -InputObject $Result;```

The result is simply:

```Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At line:9 char:1
+ Invoke-RestMethod -Method Get -Uri $Uri -Headers $Headers -Verbose;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt 
   pWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe 
   ll.Commands.InvokeRestMethodCommand```
Rapid account: Enclout
enclout Commented hace 10 años

Hey. Thanks for using my APIs. May I ask what auth_token you are using? you can email me directly at enclout@gmail.com

Join in the discussion - add comment below:

Login / Signup to post new comments