Errors¶
Every response includes a “status” key that indicates the success or failure of an API request. The “status” codes follow conventional HTTP response codes. Status 200 indicates a successful request. In the event of an error (any status code other than 200), error_type and error_message keys are also included in the request.
Error Codes¶
| 200- OK | Successful request |
| 400- Bad Request | Unacceptable Request |
| 401- Unauthorized | User could not be authenticated |
| 404- Not Found | Requested resource does not exist |
Error Types and Messages¶
If the response status is anything other than 200, error_type and error_message keys are included in the request. The error_message includes more specific information about the error type.
Possible error types include:
authentication_faileduser could not be authenticatedauthorization_failedmissing or invalid API keyobject_not_foundrequested object (usually a Castie, Group, or User) could not be foundinactive_userthe requested profile is not activecastie_not_createdcastie could not be created/saved to databasecomment_not_createdcomment not saved to databaseaccount_not_creatednew Cassie account could not be created/saved to databaseemail_not_uniqueemail address is already associated with an existing accounthandle_not_uniquehandle is already associated with an existing accountincorrect_request_typemaking a GET request when it should be POST and vice versainvalid_requestrequest could not be completedimproper_group_requesttrying to follow/unfollow a group you already follow/unfollowmissing_request_datathe expected POST/GET data was not found in the requestcastie_not_answerablethe Castie is not accepting the correct answer (either the end date has not passed or it is already answered)cannot_forecastthe User cannot submit a forecast becuase they have already done so (a User can only forecast each Castie one time)cannot_add_frodadthe User is trying to send a friend request to another User that is already a friendimproper_frodad_responsethe only acceptable actions for responding to a friend request are “accept” and “reject”