Troubleshooting API Keys

Modified on Thu, 11 Jul at 4:16 PM

An API key is a unique string of randomly generated characters used to authenticate clients and grant access to an API. You can generate API keys in the BR-DGE Portal.


The keys will be specific to a Retail channel and environment (Sandbox | Production), and grouped into two main classes based on how they will be used; Server and Client.


This article provides guidance on common issues related to API keys and steps to resolve them, including handling HTTP 401 errors.


Common Issues with API Keys

1. HTTP 401 Error

An HTTP 401 error indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. This error can occur due to several reasons:


  • Revoked API Key: The API key may have been revoked.
  • Incorrect API Key: The key may be mistyped or copied/pasted incorrectly.
  • Wrong Type of Key: Using a server key in a client context or vice versa.


2. Invalid API Key

If the API key is invalid, it means the key is not recognised by the API. This can occur if the key is incorrectly entered.


3. Permissions Issues

The API key may not have the necessary permissions to access the requested resource. Ensure that the key has the correct scope and privileges.


Resolving HTTP 401 Errors


1. Check API Key Status

Ensure that the API key is active and has not been revoked. Log into the BR-DGE Portal and verify the status of the key.


2. Verify API Key Correctness

Double-check the API key for any typographical errors. When copying and pasting the key, ensure no extra spaces or characters are included.


3. Use the Correct Key Type

Ensure that you are using the appropriate type of key:


  • Server API Keys: Must only be used on your server and should never be exposed to client applications.
  • Client API Keys: Should be used in client applications for features like Hosted Fields, Drop-In UI, and 3-D Secure.


4. Environment Matching

Verify that the API key is being used in the correct environment (Sandbox or Production). Keys are environment-specific and won't work if used in the wrong context.


If you continue to experience issues, do not hesitate to reach out to our BR-DGE Customer Support team for help.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article