OAuth Generated Errors
The following are the errors generated from both the key and resource endpoints. Note that many of the errors are the same; they are broken out to show what errors are returned under which conditions:
Token Endpoint Errors | Protected resource endpoint |
Condition: When api key (client_id) not found in request Error: HTTP/1.1 400 Bad Request {"error":"invalid_request"} |
Condition: When token not found in request (Authorization header for MAC and Authorization header, query string or submitted form for Bearer) Error: HTTP/1.1 401 Unauthorized |
Condition: When developer not found Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When token not found in request but caller attempted to authenticate with OAuth (we can tell the attempted token type but can't find the token) and the token type doesn't match the one supported by the service Error: HTTP/1.1 401 Unauthorized |
Condition: When developer is found to be inactive Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When no mapi found for the token in request (i.e., no corresponding token record in db) or developer config not found for the mapi (not sure how this could happen) Error: HTTP/1.1 401 Unauthorized |
Condition: When invalid referer (if configured) Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When developer is found to be inactive Error: HTTP/1.1 401 Unauthorized |
Condition: When authentication fails due to bad Authorization header (e.g., anything other than Basic) Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When token type indicated in request (through authentication method) doesn't match the recorded token type Error: HTTP/1.1 401 Unauthorized |
Condition: When authentication fails due to bad credentials (e.g., client_id doesn't match the one in Authorization header, or bad secret) Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When token expired Error: HTTP/1.1 401 Unauthorized |
Condition: When authentication fails due to missing credentials (e.g., no Authorization header and no client_secret submitted with application/x-www-form urlencoded form) Error: HTTP/1.1 401 Unauthorized {"error":"invalid_client"} |
Condition: When MAC nonce or mac param are missing Error: HTTP/1.1 401 Unauthorized |
Condition: When any other error encountered until createAccessToken (e.g., limiting, scheduled maintenance, etc.) Error: HTTP/1.1 <corresponding status code and message> {"error":"<error code (int)>"} |
Condition: When MAC body hash doesn't match Error: HTTP/1.1 401 Unauthorized |
Condition: When "invalid_client" error returned from createAccessToken call with rcp error code = -2001 Error: HTTP/1.1 401 Unauthorized <the returned error object, serialized to json> |
Condition: When computed mac doesn't match Error: HTTP/1.1 401 Unauthorized |
Condition: When any other error returned from createAccessToken call with rcp error code = -2001 Error: HTTP/1.1 400 Bad Request <the returned error object, serialized to json> |
Condition: When client_id/nonce not unique Error: HTTP/1.1 401 Unauthorized |
Condition: When any other error returned from createAccessToken call with rcp error != -2001 Error: HTTP/1.1 500 Internal Server Error {"error":"<error code (int)>"} |
Docs Navigation
- API Documentation Portal
- IO Docs Definition
- Mashery API Documentation
- Mashery 3.0 API Guide
- Mashery 2.0 API Guide
- OAuth Supporting Methods
- Examples
- JSON RPC
- Authentication
- API Objects
- Fetching Objects
- Query Language
- Creating Objects
- Updating Objects
- Validating Fields
- Deleting Objects
- Applications
- General Object Methods
- Members
- Packages
- Plans
- Package Keys
- Keys
- Developer Classes
- Services
- Roles
- Mashery 2.0 Reporting API Guide
- Event Trigger API
- Differences between Roles and Portal Access Groups
- Managing a Portal Access Group Using Mashery V2 or V3 API
- Mashery Reporting Event Post API Guide
- Tips and Tricks
- Your Portal
- API Traffic Manager
- I/O Docs WSDL requirements