Skip to content

Get stream events

GET
/streams/{id}/events
curl --request GET \
--url 'https://legion.picogrid.com/v2/streams/example/events?paging_direction=forwards'

Gets all events for your stream paginated

id
required
string

The id of the stream you want to get events for

limit
string

The maximum number of items to return with a default value of 10. Note that a request never returns more than about 1MB of data irrespective of how high this value is

cursor
string

The cursor given by your previous request used to get the next page of results. Defaults to start from the beginning if forwards and end if backwards

paging_direction
string
Allowed values: forwards backwards

The direction for the pagination cursor. Defaults to backwards

org_id
string

The id of the organization to get stream hls url for

event_type_id
string

This parameter allows you to filter by a specific event type in your query. If not specified all events of any event type will be fetched

start
string

The earliest timestamp you want included in your query. It defaults to the beginning of time. The format is a string containing an integer in epoch milliseconds as explained further here: https://en.wikipedia.org/wiki/Unix_time

end
string

The latest timestamp you want included in your query. It defaults to the end of time. The format is a string containing an integer in epoch milliseconds as explained further here: https://en.wikipedia.org/wiki/Unix_time

Success

Media typeapplication/json
object
data
required
Array
One of:
Event On A Blob Fragment
object
id
required
string
primitive_fragment_type
required

This key can be used as a discriminator for which type of event you have received. In this case the value is ‘blob’. The fragment this event occurred on is stored in our blob storage, which we use for large files and unstructured data, so we provide the fragment to you via the presigned url found in this object.

string
Allowed values: blob
presigned_url
required

An http url you can send a GET request to in order to fetch the blob data of the fragment this event occurred on. If it is an image for example you can use this url directly in an <img> tag to display the image. The url is only valid for 24 hours, so will need to be refetched after that time if needed. The url should be treated as a secret token, and only shared with people you want to have access to the data.

string
confidence
required

The confidence of the processor that it classified the event correctly as a percentage from 0-100

number
<= 100
timestamp
required

The time which this event occurred at. The timestamp is an epoch milliseconds integer. See https://en.wikipedia.org/wiki/Unix_time for more information

integer
processed_timestamp
required

The time the event was created. The timestamp is an epoch milliseconds integer. See https://en.wikipedia.org/wiki/Unix_time for more information

integer
location
required
Location

Gives multiple different formats and units to choose between that all represent the location of the resource

object
lat_long_alt
required
Latitude, Longitude, Altitude

Provides the latitude and longitude of the resource using WGS84, and the altitude of the resource in meters above sea level

object
altitude
required

The altitude of the resource in meters above sea level

number
latitude
required
number
>= -90 <= 90
longitude
required
number
>= -180 <= 180
meta_data
required

Any additional metadata that the processor wanted to add to the event. See meta_data documentation for more information

object
key
additional properties
event_type_id
required
string
fragment_type_id
required
string
stream_id
required
string
terminal_id
required
string
pagination
required
One of:
No More Pages
object
has_more
required

Is false in this case which means you have reached the end of available results

boolean
Example
{
"data": [
{
"primitive_fragment_type": "blob"
}
],
"pagination": {
"has_more": false
}
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Bad Request Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Authentication Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Unauthorized Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Resource Not Found Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Timeout Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Bad Gateway Error

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}
Access-Control-Allow-Origin
string
default: *
Example
https://developer.mozilla.org

The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin. - MDN Link

Access-Control-Allow-Credentials
boolean
default: true

The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link

Version 2 · commit 0771262