Search
Search in bookings
On every endpoint that returns a list og bookings, you can add a search query parameter. Search uses the following format: ?search=attribute:value;attribute:value.
Searchable fields
You can search for bookings based on the following booking properties:
- graph
- state
- completed
- created_at
- updated_at
- project.id
Let's look at a few examples:
Ex. 1: Search based on graph
Let's say we want to filter all our bookings based on their graph. Using the search query parameter, we can send the following request:
curl# [GET] /bookings
curl -X POST \
-H 'Timekit-App: back-to-the-future' \
-u doc.brown@timekit.io:nvHfRSlhvsnlg4rS7Wt28Ty47qdgegwSu3YK7hPW \
https://api.timekit.io/v2/bookings?search=graph:confirm_decline
Which would return all bookings using the confirm_decline graph:
json{
"data": [
{
"id": "f68979ff-27da-4afd-8d0c-847f9340331b",
"state": "declined",
"graph": "confirm_decline",
"completed": true,
"created_at": "2016-02-11T12:39:45+0100",
"updated_at": "2016-02-11T13:12:01+0100",
"available_actions": [],
"attributes": {
"event_info": {
"start": "2015-01-01T09:00:00+0100",
"end": "2015-01-01T14:00:00+0100",
"what": "Mens haircut",
"where": "Sesame St, Middleburg, FL 32068, USA",
"description": "Please arrive 10 minutes before you time begin"
}
},
"calendar": {
"id": "c91c5d04-2a57-46c0-ab35-e489dadf132e",
"name": "My calendar",
"display_name": "My calendar",
"description": "Ut adipisci non autem cum ut id.",
"foregroundcolor": "#25d6be",
"backgroundcolor": "#ea1cb8",
"created_at": "2016-02-15T13:21:42+0100",
"updated_at": "2016-02-15T13:21:42+0100"
},
"customers": [
{
"id": "a728e860-99c7-4009-8843-7d9ac5d7f53f",
"name": "Marty McFly",
"email": "marty.mcfly@timekit.io",
"phone": "1-591-001-5403",
"voip": "McFly",
"timezone": "America/Los_Angeles"
}
]
},
{
"id": "f68979ff-27da-4afd-8d0c-847f9340331b",
"state": "tentative",
"graph": "confirm_decline",
"completed": false,
"created_at": "2016-02-11T12:39:45+0100",
"updated_at": "2016-02-11T13:12:01+0100",
"available_actions": [
"confirm",
"decline"
],
"attributes": {
"event_info": {
"start": "2015-01-01T09:00:00+0100",
"end": "2015-01-01T14:00:00+0100",
"what": "Mens haircut",
"where": "Sesame St, Middleburg, FL 32068, USA",
"description": "Please arrive 10 minutes before you time begin"
}
},
"calendar": {
"id": "c91c5d04-2a57-46c0-ab35-e489dadf132e",
"name": "My calendar",
"display_name": "My calendar",
"description": "Ut adipisci non autem cum ut id.",
"foregroundcolor": "#25d6be",
"backgroundcolor": "#ea1cb8",
"created_at": "2016-02-15T13:21:42+0100",
"updated_at": "2016-02-15T13:21:42+0100"
},
"customers": [
{
"id": "a728e860-99c7-4009-8843-7d9ac5d7f53f",
"name": "Marty McFly",
"email": "marty.mcfly@timekit.io",
"phone": "1-591-001-5403",
"voip": "McFly",
"timezone": "America/Los_Angeles"
}
]
}
]
}
Ex. 2: Search based on graph and state
You can add multiple criteria to a search, by separating each criteria with a semicolon (;). So if we want to filter based on graph and state, we can send the following request:
curl# [GET] /bookings
curl -X POST \
-H 'Timekit-App: back-to-the-future' \
-u doc.brown@timekit.io:FluxCapacitator \
https://api.timekit.io/v2/bookings?search=graph:confirm_decline;state:tentative
Which would return all bookings using the confirm_decline graph that are in a tentative state:
json{
"data": [
{
"id": "f68979ff-27da-4afd-8d0c-847f9340331b",
"state": "tentative",
"graph": "confirm_decline",
"completed": false,
"created_at": "2016-02-11T12:39:45+0100",
"updated_at": "2016-02-11T13:12:01+0100",
"available_actions": [
"confirm",
"decline"
],
"attributes": {
"event_info": {
"start": "2015-01-01T09:00:00+0100",
"end": "2015-01-01T14:00:00+0100",
"what": "Mens haircut",
"where": "Sesame St, Middleburg, FL 32068, USA",
"description": "Please arrive 10 minutes before you time begin"
}
},
"calendar": {
"id": "c91c5d04-2a57-46c0-ab35-e489dadf132e",
"name": "My calendar",
"display_name": "My calendar",
"description": "Ut adipisci non autem cum ut id.",
"foregroundcolor": "#25d6be",
"backgroundcolor": "#ea1cb8",
"created_at": "2016-02-15T13:21:42+0100",
"updated_at": "2016-02-15T13:21:42+0100"
},
"customers": [
{
"id": "a728e860-99c7-4009-8843-7d9ac5d7f53f",
"name": "Marty McFly",
"email": "marty.mcfly@timekit.io",
"phone": "1-591-001-5403",
"voip": "McFly",
"timezone": "America/Los_Angeles"
}
]
}
]
}