Authentication Errors
Solutions for API authentication errors in API Mapper
Authentication Errors
"401 Unauthorized"
Symptoms: API returns a 401 status code.
Meaning: Your credentials are missing or invalid.
Solutions:
-
Verify your API key/credentials
- Copy the key directly from your API provider dashboard
- Check for leading/trailing spaces
- Ensure the key hasn't expired
-
Check the authentication type
- Confirm you're using the correct auth method (API Key, Bearer, Basic)
- Some APIs require the key in a header, others in query parameters
-
Verify header/parameter name
- Common header names:
Authorization,X-API-Key,api-key - Check the API documentation for the exact name
- Common header names:
Common mistakes:
| Wrong | Correct |
|---|---|
Bearer: TOKEN | Bearer TOKEN (no colon) |
APIKey abc123 | Bearer abc123 or just abc123 |
| Key in header when API expects query param | Match what API expects |
"403 Forbidden"
Symptoms: API returns a 403 status code.
Meaning: You're authenticated but not authorized for this resource.
Possible causes:
- API key doesn't have required permissions
- Resource requires a higher subscription tier
- IP restrictions
- Rate limit exceeded
Solutions:
-
Check API key permissions
- Many APIs have read/write permission levels
- Ensure your key has "read" permission at minimum
-
Verify your API subscription
- Some endpoints require paid plans
- Check your API provider account
-
Check IP restrictions
- Some APIs limit access to specific IPs
- Whitelist your server's IP address
-
Check rate limits
- Some APIs return 403 when rate limited
- Enable caching to reduce API calls
"Invalid API key" / "Consumer key is invalid"
Symptoms: API explicitly says the key is invalid.
Solutions:
-
Regenerate the API key
- Old keys may have been revoked
- Create a new key in your API provider dashboard
-
Check key format
- Some APIs have multi-part keys (key + secret)
- Ensure you're using all required parts
-
Wait for key activation
- Some APIs (like OpenWeatherMap) require 10-15 minutes for new keys to activate
For WooCommerce specifically:
- Use Consumer Key as username
- Use Consumer Secret as password
- Ensure HTTPS is enabled (WooCommerce requires it for API auth)
"Token expired" / "JWT expired"
Symptoms: Bearer token authentication fails with expiration message.
Meaning: Your access token has expired.
Solutions:
-
Generate a new token
- Log into your API provider
- Generate a fresh access token
- Update the token in API Mapper
-
Check token lifetime
- Some tokens expire after hours, others after days
- Note the expiration for future reference
-
Consider using refresh tokens (if available)
- Some APIs provide refresh tokens for automatic renewal
- This may require custom implementation
"Basic Auth required"
Symptoms: API requires username and password authentication.
Solutions:
- Go to Settings → API Mapper
- Edit your connection
- Set Authentication to Basic Auth
- Enter your Username and Password
- Save and test the connection
Note: Basic Auth credentials are sent with every request. Always use HTTPS to protect your credentials.
Was this page helpful?