Whois

PAGADO
Por enclout | Actualizada 한 달 전 | Other
Health Check

N/A

Volver a todas las conversaciones

401 Unauthorized

Rapid account: Pcgeek 86
pcgeek86
10년 전

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 10년 전

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

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios