Skip to content

Click in-app to access the full platform documentation for your version of DataRobot.

Dedicated Prediction API reference

This reference provides additional documentation for the Prediction API to help you successfully use the API. The following pages list the methods, input and output parameters, and errors that may be returned by the API. This reference supplements the information provided in the User's Guide's Prediction API pages. There, you can also find information about prerequisites and best practices and instructions for obtaining your configured predictions URL.

When using these examples, be sure to replace https://your-company.orm.datarobot.com with the name of your dedicated prediction instance. If you do not know whether you have a dedicated prediction instance, or its address, contact your DataRobot representative.

General errors for Prediction API

These errors may be returned from any Prediction API calls, depending on the issue. They are common to all endpoints.

Authorization

HTTP Code Sample error message Reason(s)
401 UNAUTHORIZED {"message": "Invalid API token"}
  • Provided an invalid or no API token key (Basic Auth).
  • Provided an invalid or no API token key (Bearer Auth).
  • Provided an invalid username with a valid API token key (Basic Auth).
401 UNAUTHORIZED {"message": "Invalid Authorization header. No credentials provided."} Did not provide an API token key (Bearer Token Auth).
401 UNAUTHORIZED {"message": "The datarobot-key header is missing"}
  • Did not provide a DataRobot key parameter for a project that requires one.
  • Provided an empty DataRobot key parameter.
  • Provided an invalid DataRobot key parameter.

Parameters

HTTP Code Sample error message Reason(s)
400 BAD REQUEST {"message": "passthroughColumns do not match columns, columns expected but not found: [u'Name']"} Provided the name of a column that does not exist.
422 UNPROCESSABLE ENTITY {"message": "'wd': wd is not allowed key"} Provided an unsupported parameter, e.g., wd.
422 UNPROCESSABLE ENTITY {"message": "'passthroughColumns': blank value is not allowed"} Provided an empty value for the passthroughColumns parameter.
422 UNPROCESSABLE ENTITY {"message": "'passthroughColumnsSet': value is not exactly 'all'"} Needed to provide the all value for the passthroughColumnsSet parameter, and provided some other value (or empty).
422 UNPROCESSABLE ENTITY {"message": "'passthroughColumns' and 'passthroughColumnsSet' cannot be used together"} Passed parameters for both passthroughColumns and passthroughColumnsSet in the same request. Need to pass parameters in separate requests.
422 UNPROCESSABLE ENTITY {"message": "'predictionWarningEnabled': value can't be converted to Bool"} Provided an invalid (non-boolean) value for predictionWarningEnabled parameter.

Payload

HTTP Code Sample error message Reason(s)
400 BAD REQUEST {"message": "Submitted file '10k\_diabetes.xlsx' has unsupported extension"} Provided a file with an unsupported extension, e.g., .xlsx.
400 BAD REQUEST {"message": "Bad JSON format"} Provided raw text with content type application/JSON.
400 BAD REQUEST {"message": "Mimetype '' not supported"} Provided an empty body with the Text mimetype.
400 BAD REQUEST {"message": "No data was received"} Provided an empty body with application/JSON content-type.
400 BAD REQUEST {"message": "Mimetype 'application/xml' not supported"} Provided a request with unsupported mimetype.
400 BAD REQUEST {"message": "Requires non-empty JSON input"} Provided empty JSON, {}.
400 BAD REQUEST {"message": "JSON uploads must be formatted as an array of objects"} Provided JSON was malformatted: {"0": {"PassengerId": 892, "Pclass": 3}}
400 BAD REQUEST {"message": "Malformed CSV, please check schema and encoding.\nError tokenizing data. C error: Expected 11 fields in line 5, saw 12\n"} Provided CSV has issues: 1 row has more fields than expected (in this instance).
413 Entity Too Large {"message": "Request is too large. The request size is $content\_length bytes and the maximum message size allowed by the server is 50MB"} Provided file is too large. DataRobot accepts files of up to 50MB in size; if file size exceeds the limit, the batch-scoring tool should be used. The same limit is applied for archived datasets.
422 UNPROCESSABLE ENTITY {"message": "No data to predict on"} Provided an empty request payload.
422 UNPROCESSABLE ENTITY {"message": "Missing column(s): Age, Cabin, Embarked, Fare, Name, Parch, PassengerId, Pclass, Sex & SibSp"} Dataset is missing all required fields. Use a dataset from the project you try to predict on, with expected fields.

Prediction API infinity behavior

IEEE-754, the standard for floating-point arithmetic, defines finite numbers, infinities, and a special NaN (not-a-number) value. According to RFC-8259, infinities and NaN are not allowed in JSON. DataRobot tries to replace these values before they are returned in APIs using the following rules:

  • Inf is replaced with 1.7976931348623157e+308 (double precision floating-point max).

  • -Inf is replaced with -1.7976931348623157e+308 (double precision floating-point min).

  • NaN is replaced with 0.0.

The Predictions API rounds floating-point numbers to 10 decimal places. However, the rounding logic changes when the floating point minimum and maximum are rounded below and above the limits, respectively:

  • 1.7976931348623157e+308 (double precision floating-point max) is returned as 1.797693135e+308 (greater than the maximum limit).

  • -1.7976931348623157e+308 (double precision floating-point min) is returned as -1.797693135e+308 (lower than the minimum limit).

  • Note that CPython’s built-in JSON parser parses such values as inf and -inf respectively, but some other languages may crash.


Updated December 1, 2021
Back to top