Pular para o conteúdo principal

Troubleshooting Guide

This guide helps you resolve common issues when working with the XD Soba API.

Common Issues

Authentication Errors

401 Unauthorized

  • Check if your token is valid and not expired
  • Verify the token format: Bearer your_token_here
  • Ensure you're using the correct credentials

403 Forbidden

  • Verify your account has the necessary permissions
  • Check if your API key is active
  • Contact support if you need access to specific endpoints

Rate Limiting

429 Too Many Requests

  • Check the rate limit headers in the response
  • Implement exponential backoff in your retry logic
  • Consider implementing caching to reduce API calls

Validation Errors

400 Bad Request

  • Verify all required fields are present
  • Check data types and formats
  • Ensure date formats are correct (ISO 8601)
  • Validate string lengths and numeric ranges

Error Codes

CodeDescriptionSolution
AUTH_001Invalid credentialsCheck username and password
AUTH_002Token expiredRequest a new token
AUTH_003Invalid token formatEnsure proper Bearer token format
VAL_001Required field missingCheck request payload
VAL_002Invalid data typeVerify field types
VAL_003Value out of rangeCheck numeric limits
RATE_001Rate limit exceededImplement backoff strategy
PERM_001Insufficient permissionsContact support

Debugging Tips

Request Logging

Enable request logging in your application:

// C# example
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Debug", "true");

Response Headers

Check these headers for additional information:

  • X-Request-ID: For tracking requests
  • X-RateLimit-*: For rate limit information
  • X-Error-Code: For detailed error codes

Common Solutions

  1. Token Issues

    # Verify token format
    curl -X GET "https://api.xdsoba.com/api/your-endpoint" \
    -H "Authorization: Bearer your_token_here" \
    -v
  2. Rate Limiting

    # Check rate limit headers
    curl -X GET "https://api.xdsoba.com/api/your-endpoint" \
    -H "Authorization: Bearer your_token_here" \
    -I
  3. Validation Errors

    # Test with minimal payload
    curl -X POST "https://api.xdsoba.com/api/your-endpoint" \
    -H "Content-Type: application/json" \
    -d '{"required_field": "value"}'

Getting Help

If you're still experiencing issues:

  1. Check Documentation

  2. Contact Support

    • Email: support@xdsoba.com
    • Include:
      • Error code and message
      • Request ID (if available)
      • Steps to reproduce
      • Relevant code snippets
  3. Community Support