Error Handling Guide for the DNA API Developer Portal 

When working with the DNA API, you may encounter errors due to incorrect requests, authentication issues, or server-related problems. This guide explains common API errors, their causes, and how to resolve them effectively. 

Client Errors (4xx) 

Client errors indicate issues with the request, such as incorrect parameters or authentication failures. 

400 Bad Request 

Cause: The request is malformed or contains invalid parameters, typically due to an incorrect Person ID
Solutions:

    • Verify that the Person ID is correct for the record you're requesting.
    • Check the request body and query parameters against the API documentation.
    • Ensure that JSON or XML payloads are properly formatted.

401 Unauthorized

  • Cause: Authentication failed for reasons like:
    • Not logged into your account.
    • Trying to access data from a different account.
    • Missing, incorrect, or expired subscription key.
  • Solution:
    • Log into your account and ensure the session is active.
    • Verify that you are requesting data from the correct account.
    • Double-check that the API key or token is valid and included in the request headers.

403 Forbidden 

Cause: The request is valid, but you lack permission to access the resource. 
Solution: 

    • Ensure your account has the correct permissions. 
    • Contact support if you believe you should have access. 

404 Not Found 

Cause: The requested API endpoint or resource does not exist. 
Solution: 

    • Double-check the API URL. 
    • Ensure the resource exists before making the request. 

Server Errors (5xx) 

Server errors indicate an issue with the DNA API itself. If you encounter any 500-level errors, log a support ticket with the details listed below. 

    • API endpoint being accessed: Specify the exact endpoint that was being called.
    • Your Developer Portal Username and Account ID: These will help us identify your account and the request.
    • Full request details (excluding sensitive data): Provide the full details of your API request, such as headers, parameters, etc.
    • Response received (including headers): Include the exact error response, including headers, received from the API.
    • Timestamp of the issue: Include the exact time when the issue occurred, including the time zone.
    • Screenshot of your entire screen, highlighting the error: A screenshot of the error will be helpful for further investigation.

You can submit a support ticket through the following link.