Beginner LevelREST APIs & Web Services
What is RFC 7807 Problem Details for HTTP APIs?
❓ Interview Prompt: Explain RFC 7807 standard JSON error payload structure (`type`, `title`, `status`, `detail`, `instance`) and `application/problem+json` media type.
RFC 7807 (updated by RFC 9457) defines a standardized format for carrying machine-readable error details in HTTP response payloads, eliminating inconsistent custom error formats across APIs:
Standard Media Type:
'Content-Type: application/problem+json'
Standard Fields:
•
'type': URI reference identifying the error type.
•
'title': Short human-readable summary.
•
'status': HTTP status code.
•
'detail': Explanation specific to this occurrence.
•
'instance': URI identifying the specific request instance.
Code Implementation Example
json
{
"type": "https://api.example.com/errors/insufficient-funds",
"title": "Insufficient Funds",
"status": 400,
"detail": "Your account balance ($20.00) is lower than the transaction amount ($50.00).",
"instance": "/api/v1/accounts/123/transactions/trans_99"
}💡Standard RFC 7807 problem+json error response payload.
🎯 Interview Key Takeaway
Adopt RFC 7807 application/problem+json format for consistent machine-readable error responses.
#RFC 7807#Error Handling#JSON#Beginner
Back to all REST APIs & Web Services Questions→