Search documentation
karat

+

K

User Documentation ↗
Version 1.0

Search observation histories

POST/api/gotham/v1/observations/history/{observationSpecId}/search
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Returns Observation histories for Geotime Tracks matching the supplied query, clipped to a specified time window. This endpoint has two distinct time filters that serve different purposes:

  • query.time determines which Tracks are returned — only Tracks whose most recent Observation falls within that range are included.
  • historyWindow determines how much history is returned for each matched Track — observations outside this window are excluded from the response.

These filters are independent and can be set to different ranges. If historyWindow is omitted, it defaults to the past 7 days. All results are constrained to Observations conforming to the specified Observation Spec.

Path parameters

observationSpecId
string

Search results will be constrained to Observations conforming to this Observation Spec.

Query parameters

preview
boolean
optional

Represents a boolean value that restricts an endpoint to preview mode when set to true.

Request body

SearchObservationHistoryRequest
object
Hide child attributes

Hide child attributes

query
object

The query to match to Geotime Tracks.

Show child attributes

Show child attributes

historyWindow
object
optional

Filters which Tracks appear in results. Only Tracks whose most recent Observation has a timestamp within this inclusive range will be matched. Defaults to 7 days if not set. This does not affect how much history is returned for matched Tracks — use historyWindow for that.

Show child attributes

Show child attributes

pageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and populate the next request's pageToken field with it.

Response body

SearchObservationHistoryResponse
object

Success response

Hide child attributes

Hide child attributes

data
list<Track>
optional
Show child attributes

Show child attributes

nextPageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and populate the next request's pageToken field with it.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/gotham/v1/observations/history/baz/search?preview=true" \ -d '{"query":{"time":{"start":"2023-01-01T12:00:00Z","end":"2023-03-07T12:10:00Z"},"historyWindow":{"start":"2023-03-07T12:00:00Z","end":"2023-03-07T12:10:00Z"}}}'

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 { "data": { "trackRid": "ri.gotham-1.1.foo.bar.baz.track0", "observations": [ { "sourceSystemId": "foo", "collectionId": "bar", "observationSpecId": "baz", "trackId": "track0", "position": { "longitude": 0, "latitude": 0 }, "timestamp": "2023-03-05T17:00:00Z", "name": "name0", "staticProperties": [], "liveProperties": [] }, { "sourceSystemId": "foo", "collectionId": "bar", "observationSpecId": "baz", "trackId": "track0", "position": { "longitude": 11, "latitude": 1 }, "timestamp": "2023-03-05T17:10:00Z", "name": "name0", "staticProperties": [], "liveProperties": [] } ] } }