Skip to main content

Error Handling

The Agrograph REST API uses standard HTTP status codes to indicate the success or failure of an API request. Here are the primary status codes you might encounter:

HTTP STATUS CODEDESCRIPTION
200 OKA valid input received, extraction performed
400 BAD_REQUESTInvalid input received
500 INTERNAL_SERVER_ERRORUnexpected error encountered in the server side code

200 OK

HTTP status code 200 OK is returned if the input JSON payload is properly structured and the extraction will be performed for each of 500 random geometries (testing). The results of the extractions will be sent back with the output JSON payload.

400 BAD_REQUEST

HTTP status code 400 BAD REQUEST is returned if the input JSON payload is not properly structured, or results in no variables being selected for extraction (usually due to the combination of annual and static settings). No extraction is performed in such cases and an explanatory message is returned.

500 INTERNAL_SERVER_ERROR

HTTP status code 500 INTERNAL SERVER ERROR is returned if the server-side application encounters an unexpected error. This should never happen on a production server, however, if it does, the 500 INTERNAL SERVER ERROR will be returned together with the description of an exception raised and application stack frames. This information will assist developers in diagnosing and remedying the error. The 500 error is not caused by an end-user and cannot be fixed by user action — developer intervention is required.