Buckets
GET Buckets¶
curl https://{root_url}/bucket-planning/v2/buckets/123123-1181-4aab-a177-dd845287cd55/ \
-H 'apikey: {YOUR_API_KEY}'
{
"id": "123123-1181-4aab-a177-dd845287cd55",
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 1500.0
},
"arrival_stop": {
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 900.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"mutable": true,
"created": "2019-07-31T22:06:32Z",
"modified": "2019-08-01T02:34:20Z",
"external_data": {
"date": "2019-09-28",
"name": "Den Hoorn"
},
"current_state": "initialized",
"old_state": "initializing",
}
Available query params¶
Name | format | Description | Example |
---|---|---|---|
id | GUID | Filters by the event by ID | id=033a0417-e2ce-41e3-800a-55543d4a664 |
current_state | Enum | Filter by bucket current state | current_state=initialized |
old_state | Enum | Filter by bucket old state | current_state=initialized |
limit | Integer | Sets the maximum amount of results the request answer is going to contain | limit=2 |
offset | Integer | Sets the initial index from which the results are going to be returned. | offset=10 |
POST Bucket¶
Tip
To ensure optimal results, make sure to include all the attributes shown in this example.
curl https://{root_url}/bucket-planning/v2/buckets/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
-d '{
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"geo_point": {
"latitude": 22.222222,
"longitude": 14.123123
},
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"stop_time": 1500.0
},
"arrival_stop": {
"geo_point": {
"latitude": 22.222222,
"longitude": 14.123123
},
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"stop_time": 900.0
},
"timeslot_windows": [
{
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
],
},
"external_data": {}
}'
{
"id": "123123-cfe3-468f-90af-188a004da93e",
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 1500.0
},
"arrival_stop": {
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 900.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"mutable": true,
"created": "2019-08-01T03:25:58Z",
"modified": "2019-08-01T03:25:58Z",
"external_data": {},
"current_state": "new",
"old_state": "empty"
}
POST Buckets in bulk¶
curl https://{root_url}/bucket-planning/v2/buckets/bulk/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
-d '[
{
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"stop_time": 100.0
},
"arrival_stop": {
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"min_time": "2019-08-05T08:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"stop_time": 0.0
},
"timeslot_windows": [
{
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"external_data": {}
},
{
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"stop_time": 100.0
},
"arrival_stop": {
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"min_time": "2019-08-05T08:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"stop_time": 0.0
},
"timeslot_windows": [
{
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"external_data": {}
}
]'
[
{
"id": "c7028be1-a072-42cb-ba28-59d13a5bfaa9",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"stop_time": 100.0
},
"arrival_stop": {
"min_time": "2019-08-05T08:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"planning_profile": "foo-profile",
"mutable": true,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-01T03:28:16Z",
"modified": "2019-08-01T03:28:16Z",
"external_data": {}
},
{
"id": "6e901e41-d295-4a83-bdc1-26f60493b942",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"stop_time": 100.0
},
"arrival_stop": {
"min_time": "2019-08-05T08:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 5.123123
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"planning_profile": "foo-profile",
"mutable": true,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-01T03:28:16Z",
"modified": "2019-08-01T03:28:16Z",
"external_data": {}
}
]
Initialize/Finalize/Cancel Bucket¶
Tip
The action to initialize a bucket is: initialize
The action to finalize a bucket is: finalize
The action to cancel a bucket is: cancel
curl https://{root_url}/bucket-planning/v2/buckets/12312312-af30-479f-9539-879515a930fc/actions/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '{"action": "initialize"}'
{
"id": "12312312-af30-479f-9539-879515a930fc",
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 1500.0
},
"arrival_stop": {
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 900.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"mutable": true,
"created": "2019-08-01T03:25:58Z",
"modified": "2019-08-01T03:30:29Z",
"external_data": {
"date": "2019-09-28",
"name": "Den Hoorn"
},
"current_state": "initializing",
"old_state": "new"
}
Freeze Bucket¶
Tip
Freezing via the freeze
action is optional and transitions the bucket into a frozen state.
The action to freeze
a bucket consists out of two arguments seconds_before_eta
and seconds_after_eta
.
The minimal allowed time gap for both seconds_before_eta
and seconds_after_eta
is 300 seconds.
Applying a freeze
action on an already frozen bucket returns the following error: Bucket's current_state frozen
.
curl https://{root_url}/bucket-planning/v2/buckets/12312312-af30-479f-9539-879515a930fc/actions/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '{"action": "freeze", "seconds_before_eta": 3, "seconds_after_eta": 297}'
{
"id": "12312312-af30-479f-9539-879515a930fc",
"planning_profile": "foo-profile",
"algorithm_fields": {
"departure_stop": {
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 1500.0
},
"arrival_stop": {
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z",
"geo_point": {
"latitude": 52.123123,
"longitude": 14.123123
},
"stop_time": 900.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2019-08-05T07:00:00Z",
"max_time": "2019-08-05T08:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T09:00:00Z",
"max_time": "2019-08-05T11:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T11:00:00Z",
"max_time": "2019-08-05T13:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T13:00:00Z",
"max_time": "2019-08-05T21:00:00Z"
},
{
"id": null,
"min_time": "2019-08-05T22:00:00Z",
"max_time": "2019-08-05T23:00:00Z"
}
]
},
"mutable": true,
"created": "2019-08-01T03:25:58Z",
"modified": "2019-08-01T03:30:29Z",
"external_data": {
"date": "2019-09-28",
"name": "Den Hoorn"
},
"current_state": "frozen",
"old_state": "new"
}
GET mutable Buckets¶
Tip
Mutable are buckets in current_state initialized
, frozen
curl https://{root_url}/bucket-planning/v2/buckets/?mutable \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
{
"count": 156,
"next": "http://localhost:8000/v2/buckets/?mutable=true&limit=10&offset=10",
"previous": null,
"results": [
{
"id": "0b87c0e8-32ed-457b-adf6-0d4bf318e13b",
"algorithm_fields": {
"departure_stop": {
"min_time": "2017-11-13T07:00:00Z",
"max_time": "2017-11-13T12:30:00Z",
"geo_point": {
"latitude": 52.123623,
"longitude": 5.051931
},
"stop_time": 0
},
"arrival_stop": {
"min_time": "2017-11-13T12:30:00Z",
"max_time": "2017-11-13T17:30:00Z",
"geo_point": {
"latitude": 52.123623,
"longitude": 5.051931
},
"stop_time": 0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2017-11-13T07:00:00Z",
"max_time": "2017-11-13T07:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T07:30:00Z",
"max_time": "2017-11-13T08:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T08:30:00Z",
"max_time": "2017-11-13T09:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T09:30:00Z",
"max_time": "2017-11-13T10:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T10:30:00Z",
"max_time": "2017-11-13T11:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T11:30:00Z",
"max_time": "2017-11-13T12:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T12:30:00Z",
"max_time": "2017-11-13T13:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T13:30:00Z",
"max_time": "2017-11-13T14:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T14:30:00Z",
"max_time": "2017-11-13T15:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T15:30:00Z",
"max_time": "2017-11-13T16:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T16:30:00Z",
"max_time": "2017-11-13T17:30:00Z"
}
]
},
"config": {},
"mutable": true,
"current_state": "initialized",
"old_state": "initializing",
"state_reason": null,
"created": "2022-07-05T06:03:20Z",
"modified": "2022-07-05T06:03:28Z",
"external_data": null
},
{
"id": "0f98390a-b842-46a3-b15a-4be9fcd59fac",
"algorithm_fields": {
"departure_stop": {
"min_time": "2017-11-13T15:30:00Z",
"max_time": "2017-11-13T17:00:00Z",
"geo_point": {
"latitude": 52.3968885,
"longitude": 4.789829
},
"stop_time": 1500
},
"arrival_stop": {
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-14T00:00:00Z",
"geo_point": {
"latitude": 52.3968885,
"longitude": 4.789829
},
"stop_time": 900
},
"timeslot_windows": [
{
"id": null,
"min_time": "2017-11-13T15:30:00Z",
"max_time": "2017-11-13T17:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-13T17:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T17:30:00Z",
"max_time": "2017-11-13T18:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T18:00:00Z",
"max_time": "2017-11-13T19:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T19:00:00Z",
"max_time": "2017-11-13T20:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T20:00:00Z",
"max_time": "2017-11-13T21:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T21:00:00Z",
"max_time": "2017-11-13T21:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T21:30:00Z",
"max_time": "2017-11-13T22:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T22:00:00Z",
"max_time": "2017-11-14T00:00:00Z"
}
]
},
"config": {},
"mutable": true,
"current_state": "frozen",
"old_state": "initialized",
"state_reason": "_/0f98390a-b842-46a3-b15a-4be9fcd59fac",
"created": "2022-09-06T18:55:20Z",
"modified": "2022-09-06T18:56:11Z",
"external_data": {
"date": "2017-11-13",
"name": "Den Hoorn"
}
}
]
}
GET mutable Bucket (by ID)¶
Tip
Mutable are buckets in current_state initialized
, frozen
curl https://{root_url}/bucket-planning/v2/buckets/0f98390a-b842-46a3-b15a-4be9fcd59fac/?is_mutable \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
{
"id": "0f98390a-b842-46a3-b15a-4be9fcd59fac",
"algorithm_fields": {
"departure_stop": {
"min_time": "2017-11-13T15:30:00Z",
"max_time": "2017-11-13T17:00:00Z",
"geo_point": {
"latitude": 52.3968885,
"longitude": 4.789829
},
"stop_time": 1500
},
"arrival_stop": {
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-14T00:00:00Z",
"geo_point": {
"latitude": 52.3968885,
"longitude": 4.789829
},
"stop_time": 900
},
"timeslot_windows": [
{
"id": null,
"min_time": "2017-11-13T15:30:00Z",
"max_time": "2017-11-13T17:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-13T17:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T17:30:00Z",
"max_time": "2017-11-13T18:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T18:00:00Z",
"max_time": "2017-11-13T19:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T19:00:00Z",
"max_time": "2017-11-13T20:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T20:00:00Z",
"max_time": "2017-11-13T21:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T21:00:00Z",
"max_time": "2017-11-13T21:30:00Z"
},
{
"id": null,
"min_time": "2017-11-13T21:30:00Z",
"max_time": "2017-11-13T22:00:00Z"
},
{
"id": null,
"min_time": "2017-11-13T22:00:00Z",
"max_time": "2017-11-14T00:00:00Z"
}
]
},
"config": {},
"mutable": true,
"current_state": "frozen",
"old_state": "initialized",
"state_reason": "_/0f98390a-b842-46a3-b15a-4be9fcd59fac",
"created": "2022-09-06T18:55:20Z",
"modified": "2022-09-06T18:56:11Z",
"external_data": {
"date": "2017-11-13",
"name": "Den Hoorn"
}
}