Filtering events
When requesting events with the API, you can use the optional filter[]
path parameter to filter the results. Example:
GET /api/v2/users/{user_id}/events?filter[source]=coolbikes
You can include any of the following filter criteria using the format filter[{criteria}]
:
You can combine filter parameters. Example:
filter[source]=coolbikes&filter[end_date]=2020-03-16
You can also include an optional page[size]
parameter to limit the number of results returned per page. Example:
filter[source]=coolbikes&filter[end_date]=2020-03-16&page[size]=5
The response will include a links
object with links to the next or previous results page:
"links": [
{
"next": "https://..."
}
]
source
Include only events with the specified source.
filter[source]=coolbikes
type
Include only events with the specified type for a given event source. You must specify a source with the type.
filter[source]=coolbikes&filter[type]=bike_rental_booked
start_time
Include only events with a created_at
time later than or equal to the specified time. The start time is an ISO 8601 formatted date-time.
filter[start_time]=2020-03-16
end_time
Include only events with a created_at
time earlier than or equal to the specified time. The start time is an ISO 8601 formatted date-time.
filter[end_time]=2020-03-31