Errors
TeamUp uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a class is not open for registration, etc.). Codes in the 5xx range indicate an error with TeamUp's servers (these are rare).
Error Response Format
Example
{
"code": "parameter_invalid",
"field_errors": {
"offering_type": ["The offering type ID was not found"],
"non_field_errors": ["Start date cannot come after end date"]
},
"message": "You request was invalid",
"type": "invalid_request_error"
}
- code: A short string indicating the error code. Useful for handling certain errors programmatically.
- field_errors: Object where each key matches a field name in the request body, with one or more messages explaining why the provided value is invalid. A
non_field_errorskey is included for validation errors that are not specific to a single field. - message: A human-readable message providing more details about the error..
- type: The type of error returned. One of
invalid_request_error,conflict,event_check_failure
HTTP Status Code Summary
| Status Code | Status | Description |
|---|---|---|
| 200 | OK | Everything worked as expected. |
| 400 | Bad Request | The request was unacceptable, often due to missing a required parameter. |
| 401 | Unauthorized | Authentication failed due to invalid credentials. |
| 403 | Forbidden | The identity linked to the credentials (often a user) doesn't have permission to access the endpoint. |
| 404 | Not Found | The requested resource doesn’t exist. |
| 429 | Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| 500, 502, 503, 504 | Server Errors | Something went wrong on TeamUp's end. (These are rare.) |