Skip to main content

Error Codes

Comprehensive reference for all error codes returned by the Exam Portal API.

HTTP Status Codes

StatusCategoryMeaning
200SuccessRequest succeeded
201SuccessResource created
204SuccessNo content
400Client ErrorBad request/validation error
401Client ErrorUnauthorized (invalid/missing token)
403Client ErrorForbidden (insufficient permissions)
404Client ErrorResource not found
409Client ErrorConflict (resource already exists)
429Client ErrorRate limited
500Server ErrorInternal server error
503Server ErrorService unavailable

Error Response Format

{
"error": "ERROR_CODE",
"message": "Human readable message",
"status": 400,
"details": {
"field": "additional_context"
}
}

Common Error Codes

Authentication Errors

CodeStatusDescriptionSolution
UNAUTHORIZED401Missing or invalid tokenEnsure Authorization header is present with valid token
TOKEN_EXPIRED401ID token has expiredRefresh token with getIdToken(true)
INVALID_TOKEN401Token is malformed or tamperedRe-authenticate user

Authorization Errors

CodeStatusDescriptionSolution
FORBIDDEN403Insufficient permissionsCheck user role and organization access
BOLA_VIOLATION403Attempting to access other organization's dataAccess only your organization's resources
IDOR_VIOLATION403Direct object reference without authorizationSystem prevented unauthorized access

Validation Errors

CodeStatusDescriptionSolution
VALIDATION_ERROR400Input validation failedCheck request payload matches schema
INVALID_EMAIL400Email format is invalidProvide valid email address
INVALID_UUID400ID format is not valid UUIDUse valid UUID format
MISSING_FIELD400Required field is missingInclude all required fields in request

Resource Errors

CodeStatusDescriptionSolution
NOT_FOUND404Resource does not existVerify resource ID is correct
ALREADY_EXISTS409Resource already existsUse different identifier or update existing
RESOURCE_DELETED410Resource has been deletedCannot access deleted resources

Rate Limiting

CodeStatusDescriptionSolution
RATE_LIMITED429Too many requestsWait before making next request
QUOTA_EXCEEDED429Monthly quota exceededUpgrade plan or wait for renewal

Server Errors

CodeStatusDescriptionSolution
SERVER_ERROR500Internal server errorContact support if persists
SERVICE_UNAVAILABLE503Service temporarily unavailableRetry after a few moments
DATABASE_ERROR500Database connection failedTry request again

Debugging Tips

Check Error Details

# Enable verbose logging
curl -v -X GET https://api.nssoftwaresolutions.in/api/tests \
-H "Authorization: Bearer $TOKEN"

Monitor Headers

Response headers often contain additional information:

X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705320000
X-Request-Id: req-12345

Review Logs

Access application logs in GCP Cloud Logging with request IDs for detailed error traces.

Next Steps