A JSON collection response body occurs in response to a GET collection request that results in a 200 OK or a 206 Partial Content HTTP status code. For collections with fewer than 100 elements, the response body for a collection contains the identifier for all instances in the resource type collection. The response is a JSON array of zero or more instances. Each instance in the response has one or more attribute name-value pairs. The returned name-value pairs are determined by the select URI parameter, which defaults to the id attribute. You can specify which attributes to return for each instance by using the select query parameter. You can specify which instances are returned by filtering the data using an attribute expression as a query parameter.
The following example illustrates the components of a collection resource. It shows a collection resource returned in response to a GET collection request for the event resource type. In this example, the query returns the id and severity of each event in the appliance. Spaces outside the quoted strings are used for readability, and are not significant.
Request and response | Request and response example |
---|---|
Request |
GET https://1.2.3.4/api/rest/event?select=id,severity |
Response | List of all instances in the specified collection that meet the request criteria. The response includes attribute values as a set of name:value pairs for each returned instance:
[ { "id": "0a739865-a233-4ef0-ae20-6ed014ad06fe", "severity": "Minor" }, { "id": "51c0db9e-1d2b-4289-97b7-f361d67f7807", "severity": "Minor" }, . . . ] |