Result Formats
Currently, two result formats are supported: xml and json.
XML
Example XML Error Response
<response><header><locale country="" language="en"/><timestamp>2009-05-15T15:40:30.031-04:00</timestamp><criteria><command><fmt>xml</fmt><include-provisional>false</include-provisional><hotspot>true</hotspot><rtype>loc</rtype><back>14</back><max-results>10000</max-results><detail>simple</detail></command></criteria><errors><error><error-msg>Please specify a region code</error-msg><error-code>error.data.rcodes_required</error-code></error></errors></header><result/></response>
JSON
Example JSON Error Response
The response will be an HTTP 400 error code, detailing the problems encountered in a simple JSON array:
[{"errorMsg":"Latitude out of range", "errorCode":"error.data.lat_out_of_range"}, {"errorMsg":"Longitude out of range", "errorCode":"error.data.lng_out_of_range"}]
Special Conditions and Error Handling
If there are validation problems with the input parameters the response will have an appropriate HTTP status code (e.g., 400) and details of the problem will be provided in the result format requested (JSON or XML).
Current List of Error Messages
This list may change or be added to at any time. Items in brackets will be specified at the time the message is received.
error.data.dist_out_of_range = Distance must be between {0} and {1} error.data.lat_out_of_range = Latitude out of range error.data.lng_out_of_range = Longitude out of range error.data.lat_required = Parameter 'lat' is required error.data.lng_required = Parameter 'lng' is required error.data.rcodes_required = Please specify a region code error.data.rtype_required = The parameter 'rtype' for region type is required error.data.rcodes_toomany = Too many region codes. Please limit your selection to {0} region codes. error.data.too_many_back = The maximum number of days back is {0} error.data.too_few_back = Please specify a number of days back greater than zero. error.data.unknown_species = Unknown species: {0} error.data.sci_required = Please specify the scientific name of the species of interest with the parameter 'sci'. error.data.unsupported_detail = Sorry, the "{0}" detail is not currently supported for this service. error.data.unsupported_rtype = Sorry, the region type "{0}" is not currently supported for this service. error.unsupported_fmt = Sorry, {0} format is not currently supported for this service.