Bad Request (400)

A 400 (bad request) error can be returned for a number of reasons. This is a standard HTTP code used to signal that the operation failed because of a problem with the request sent by the user. This means that the server did not fail unexpectedly. Rather, it determined that the user was attempting to use the endpoint in an unsupported way.

In many cases, the request was simply malformed. A required parameter might be missing, or a parameter value might not be allowed. For instance, the user might be trying to request indicators of a type that is not supported by TruSTAR, or specifying a time range that is longer than is allowed. An endpoint might be being used with an unsupported HTTP method - for instance, POST /enclaves is not allowed, because enclaves cannot be created through the API.

Sample JSON

The call GET /reports/search would result in a 400 response with the following body:

    "timestamp": 1520924980332,
    "status": 400,
    "error": "Bad Request",
    "message": "No search term provided.",
    "path": "/api/1.3/reports/search"