Skip to main content
Index

401: Unauthorized

The 401 (Unauthorized) status code indicates that the authentication credentials received are not authorized. The user may repeat the request with a new or replaced Authorization header field. 

 

Code 401
Description Authentication Error.
Generic Cause Unauthorized authentication token.
Quick Fix Verify whether an authentication token is obtained and ensure to provide this with each request.

 

There are different types of Authentication errors and this section provides sample scenarios of authentication errors as well as tips on how to identify them.

401: Please enter a valid api key

Code

401

Description

Please enter a valid api key.

Generic Cause Invalid authorization token.
Quick Fix Check that the Authorization token and X-Auth-APIKEY are correct.

 

 Error scenario example

ERROR   

CODE:       "401"
MESSAGE:    "Please enter a valid api key"

 

Verify the Authorization token and X-Auth-APIKEY, and ensure that the correct token and api key were passed.

 

Rename the Authorization value from "Bearer qwErtY8zyW1abcdefGHIZZZZ" to "Bearer qwErtY8zyW1abcdefGHI".

curl -X

GET "https://api.equinix.com/v1/assets/11581251" 

-H "Content-type: application/json"

-H "Authorization: Bearer qwErtY8zyW1abcdefGHIZZZZ"