Error Response Format
All DRIP API errors follow a consistent format:Error Response Fields
Field | Description |
---|---|
error | Error type identifier |
message | Human-readable error description |
details | Additional error context (when available) |
requestId | Unique request identifier for support |
timestamp | When the error occurred |
HTTP Status Codes
The DRIP API uses standard HTTP status codes:2xx Success
- 200 OK: Request successful
- 201 Created: Resource created successfully
- 204 No Content: Request successful, no response body
4xx Client Errors
- 400 Bad Request: Invalid request format or parameters
- 401 Unauthorized: Missing or invalid authentication
- 403 Forbidden: Valid authentication but insufficient permissions
- 404 Not Found: Requested resource doesn’t exist
- 409 Conflict: Request conflicts with current resource state
- 422 Unprocessable Entity: Valid format but business logic error
- 429 Too Many Requests: Rate limit exceeded
5xx Server Errors
- 500 Internal Server Error: Unexpected server error
- 502 Bad Gateway: Upstream service error
- 503 Service Unavailable: Temporary service outage
- 504 Gateway Timeout: Upstream service timeout
Common Error Types
Authentication Errors
401 Unauthorized - Invalid API Key
401 Unauthorized - Invalid API Key
403 Forbidden - Insufficient Permissions
403 Forbidden - Insufficient Permissions
- API key lacks required permissions
- Trying to access another realm’s resources
- Account permissions have been changed
- Check your account permissions in the dashboard
- Ensure you’re using the correct realm ID
- Contact an admin to update permissions
Validation Errors
400 Bad Request - Invalid Parameters
400 Bad Request - Invalid Parameters
- Invalid data types (string instead of number)
- Missing required fields
- Values outside allowed ranges
- Malformed IDs
- Validate input data before sending requests
- Check API documentation for required fields and formats
- Use proper data types in your requests
422 Unprocessable Entity - Business Logic Error
422 Unprocessable Entity - Business Logic Error
- Insufficient point balance for transfers
- Duplicate resource creation
- Quest already completed
- Store item out of stock
- Check resource state before operations
- Implement proper business logic validation
- Handle edge cases gracefully
Resource Errors
404 Not Found - Resource Missing
404 Not Found - Resource Missing
- Incorrect resource IDs
- Resource has been deleted
- Member hasn’t joined the realm
- Typos in endpoint URLs
- Verify resource IDs are correct
- Check if resources exist before operations
- Handle missing resources gracefully
409 Conflict - Resource State Conflict
409 Conflict - Resource State Conflict
- Modifying completed quests
- Creating duplicate resources
- Concurrent modification conflicts
- Check resource state before modifications
- Implement proper concurrency handling
- Use appropriate HTTP methods (PUT vs PATCH)
Rate Limiting Errors
429 Too Many Requests
429 Too Many Requests
- Implement exponential backoff
- Respect the Retry-After header
- Use batch operations when possible
- See the Rate Limits guide for details
Error Handling Implementation
JavaScript/Node.js
Python
Debugging and Troubleshooting
Request ID Tracking
Always log therequestId
from error responses for support:
Common Debugging Steps
1
Verify API Key
Test your API key with a simple request:
2
Check Request Format
Ensure your request matches the API documentation:
- Correct HTTP method
- Proper JSON format
- Required headers included
- Valid parameter types
3
Validate Resource IDs
Confirm that all IDs in your request are valid:
- Realm ID exists and you have access
- Member ID exists in the realm
- Point type ID is correct
4
Test with cURL
Replicate the failing request with cURL to isolate the issue:
Error Monitoring
Set up monitoring to track error patterns:Best Practices
Graceful Degradation
- Always handle errors gracefully
- Provide meaningful user feedback
- Implement fallback behaviors
- Log errors for debugging
Retry Logic
- Implement exponential backoff
- Don’t retry client errors (4xx)
- Respect rate limit headers
- Set maximum retry limits
Error Logging
- Log all API errors with context
- Include request IDs for support
- Monitor error patterns
- Set up alerting for high error rates
User Experience
- Show user-friendly error messages
- Provide actionable next steps
- Handle loading and error states
- Implement proper error boundaries
Getting Help
When contacting support about API errors:- Include the Request ID from the error response
- Provide the full error response with status code
- Share your request details (without sensitive data)
- Describe the expected behavior vs what happened
- Include relevant logs and timestamps