Table of contents
- API Usage Guide
- API Command Reference
- add_booking
- add_client
- add_invoice
- add_resource
- approve_request
- authenticate_user
- del_booking
- del_bookings
- del_client
- del_invoice
- del_resource
- email_client
- gen_invoice
- get_activity
- get_availability
- get_booking
- get_bookings
- get_client
- get_consumable_levels
- get_invoice
- get_invoices
- get_messages
- get_reminders
- get_resource
- get_resource_availability
- get_setting
- get_template
- get_user
- get_users_logged_in
- get_venue
- get_venues
- get_venues_in_group
- get_venues_in_use
- get_watches
- mod_booking
- mod_client
- mod_invoice
- mod_resource
- notify_user
- reject_request
- restore_booking
- set_setting
- set_template
- util_from_epoch
- util_to_epoch
- Appendix A - Activity Codes
- Appendix B - Setting Names
- Appendix C - Error Handling
- Code Samples
- C#
- Java
- jQuery
- .NET
- Perl
- PHP
- Python
- Ruby
- Troubleshooting
- Release Notes
MIDAS API: Appendix C - Error Handling
When making API calls, your applications should take into account possible errors that may be returned.
API errors will be returned in JSON format as follows:
API errors will be returned in JSON format as follows:
Example Error Response |
{"error":"error response"} |
Error Response | Meaning | Applies To |
"not enabled" | API access is not enabled at this time. API access can be enabled from within MIDAS via MIDAS Admin Options → Manage Addons → API Access → Enabled | All |
"invalid api key" | You have not supplied your API key in your call, or the API key supplied is invalid. See also API Troubleshooting | All |
"GET method not allowed. Use POST instead" | An http GET request has been made to the API, but the API has been set to accept http POST requests only. This setting may be changed via MIDAS Admin Options → Manage Addons → API Access → Allow GET (as well as POST) method | All |
"API running in read only mode" | The API is currently running in read-only mode, and you have made a call that requires full-access. Read-Only mode can be turned off via MIDAS Admin Options → Manage Addons → API Access → Read-Only access | add_* |
"no matches found" | No data was returned for the API call. Try broadening the search parameters | get_activityget_bookings |
"protected setting" | The setting you're trying to modify is read-only and cannot be modified | set_setting |
"referrer not allowed" | The API call originates from a blocked domain/IP address. Allowed domains/IP's may be specified from within MIDAS via MIDAS Admin Options → Manage Addons → API Access → Allowed Referrers | All |
"required parameter missing" | One or more parameters are required for the particular call you're making is missing | All |
"unknown booking type" | Indicates that the specified booking type doesn't exist | get_bookings (when the type parameter is specified) |
"unknown command" | The API command you've specified was unrecognized. Please check you're using a valid command | All |
"unknown resource" | Indicates that the specified resource doesn't exist | get_resource_availability |
"unknown setting" | Indicates that the specified setting isn't recognized | get_setting |
"unknown template" | Indicates that the specified template isn't recognized | get_template |
"unknown user" | Indicates that the specified user doesn't exist | get_activity |
"unknown venue group" | Indicates that the specified venue group doesn't exist | get_venues_in_group |
"unknown venue" | Indicates that the specified venue doesn't exist | get_availability (when the venue parameter is specified)get_venue |