Events
GET Events¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/?limit=2 \
-H 'apikey: {YOUR_API_KEY}'
{
"count": 26,
"next": "https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/?limit=2&offset=2",
"previous": null,
"results": [
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5,
"eta": "2019-07-23T06:49:57Z",
"time_to_next": 2781.0,
"dist_to_next": 67428.0,
"frozen_window": null
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": 4,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": "2110790e-ab1a-4c93-941f-f59e335bb5b1",
"current_state": "planned",
"old_state": "initialized",
"state_reason": "_/dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
},
{
"id": "98f407c5-250f-4a41-949d-8f10757f9ecd",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5,
"eta": "2019-07-23T06:49:57Z",
"time_to_next": 2781.0,
"dist_to_next": 67428.0
},
"event_type": "delivery",
"address": {
"street": "Tweedestraat",
"postalcode": "2222BB",
"house_number": 2,
"city": "Dorp",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": 2,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": "2110790e-ab1a-4c93-941f-f59e335bb5b1",
"current_state": "planned",
"old_state": "initialized",
"state_reason": "_/98f407c5-250f-4a41-949d-8f10757f9ecd",
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
]
}
Available query params¶
Name | format | Description | Example |
---|---|---|---|
current_state | Enum | Filter by event current state | current_state=initialized |
old_state | Enum | Filter by event old state | old_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 |
GET Event by event ID¶
curl https://{root_url}/bucket-planning/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/dae6c1ea-7a95-48cc-98ea-422599f40ce6/ \
-H 'apikey: {YOUR_API_KEY}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5,
"eta": "2019-07-23T06:49:57Z",
"time_to_next": 2781.0,
"dist_to_next": 67428.0,
"frozen_window": null
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": 4,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": "2110790e-ab1a-4c93-941f-f59e335bb5b1",
"current_state": "planned",
"old_state": "initialized",
"state_reason": "_/dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
GET Frozen Event: response example¶
curl https://{root_url}/bucket-planning/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/dae6c1ea-7a95-48cc-98ea-422599f40ce6/ \
-H 'apikey: {YOUR_API_KEY}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5,
"eta": "2019-07-23T17:00:00Z",
"time_to_next": 2781.0,
"dist_to_next": 67428.0,
"frozen_window": {
"max_time": "2019-07-23T17:00:00Z",
"min_time": "2019-07-23T17:05:00Z"
}
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": 4,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": "2110790e-ab1a-4c93-941f-f59e335bb5b1",
"current_state": "planned",
"old_state": "initialized",
"state_reason": "_/dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
POST Event¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/ \
-H 'apikey: {YOUR_API_KEY}' \
-d '
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {}
}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
POST Event With Suggestion¶
curl https://{root_url}/bucket-planning/v2/buckets/a03ee56d-0021-4890-8321-00ef6f990414/events/?suggestions=2 \
-H 'apikey: {YOUR_API_KEY}'
{
"id": "a3829bea-77f8-46fe-af80-db02d0978783",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2021-11-16T17:30:00.000000Z",
"max_time": "2021-11-16T22:00:00.000000Z",
"sort_key": null,
"bucket": "a03ee56d-0021-4890-8321-00ef6f990414",
"route": null,
"current_state": "planned",
"old_state": "prepared",
"state_reason": null,
"created": "2021-11-14T10:16:15Z",
"modified": "2021-11-14T10:16:16Z",
"external_data": {},,
"resource_event_tags": [],
"route_event_tags": [],
"suggestions": [
{
"id": "20198cac-284a-4384-aaa8-4cc74c23aaf9",
"algorithm_fields": {},
"timeslot": [
"2021-11-16T18:30:00Z",
"2021-11-16T19:30:00Z"
],
"timeslot_id": null,
"cost": 1.662,
"price": null,
"event": "a3829bea-77f8-46fe-af80-db02d0978783",
"bucket_id": "a03ee56d-0021-4890-8321-00ef6f990414",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2021-11-14T10:16:15Z",
"modified": "2021-11-14T10:16:16Z"
},
{
"id": "38c1b276-2be0-408c-a56c-ec141cbe8cf0",
"algorithm_fields": {},
"timeslot": [
"2021-11-16T19:30:00Z",
"2021-11-16T22:00:00Z"
],
"timeslot_id": null,
"cost": 1.662,
"price": null,
"event": "a3829bea-77f8-46fe-af80-db02d0978783",
"bucket_id": "a03ee56d-0021-4890-8321-00ef6f990414",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2021-11-14T10:16:15Z",
"modified": "2021-11-14T10:16:16Z"
}
]
}
Available query params¶
Name | format | Description | Example |
---|---|---|---|
suggestions | Integer | Sets the number of suggestions that are going to be returned for the event. | suggestions=2 |
POST Event with Suggestion with Timeslot Windows¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/?suggestions=3 \
-H 'apikey: {YOUR_API_KEY}' \
-d '
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {},
"timeslot_windows": [
{
"min_time": "2019-07-23T04:00:00Z",
"max_time": "2019-07-23T05:30:00Z",
"id": "6291f587-800d-4114-b3c9-9bddb08d9650"
},
{
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"id": "6291f587-800d-4114-b3c9-9bddb08d9651"
},
{
"min_time": "2019-07-23T04:00:00Z",
"max_time": "2019-07-23T10:00:00Z",
"id": "6291f587-800d-4114-b3c9-9bddb08d9652"
}
]
}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-07-22T15:16:15Z",
"modified": "2019-07-22T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": [],
"suggestions": [
{
"id": "20198cac-284a-4384-aaa8-4cc74c23aaf9",
"algorithm_fields": {},
"timeslot": [
"2019-07-23T04:00:00Z",
"2019-07-23T05:30:00Z"
],
"timeslot_id": "6291f587-800d-4114-b3c9-9bddb08d9650",
"cost": 1.662,
"price": null,
"event": "a3829bea-77f8-46fe-af80-db02d0978783",
"bucket_id": "a03ee56d-0021-4890-8321-00ef6f990414",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-07-22T10:16:15Z",
"modified": "2019-07-22T10:16:16Z"
},
{
"id": "20198cac-284a-4384-aaa8-4cc74c23aaf8",
"algorithm_fields": {},
"timeslot": [
"2019-07-23T05:30:00Z",
"2019-07-23T10:00:00Z"
],
"timeslot_id": "6291f587-800d-4114-b3c9-9bddb08d9651",
"cost": 1.662,
"price": null,
"event": "a3829bea-77f8-46fe-af80-db02d0978783",
"bucket_id": "a03ee56d-0021-4890-8321-00ef6f990414",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-07-22T10:16:15Z",
"modified": "2019-07-22T10:16:16Z"
},
{
"id": "38c1b276-2be0-408c-a56c-ec141cbe8cf0",
"algorithm_fields": {},
"timeslot": [
"2019-07-23T04:00:00Z",
"2019-07-23T10:00:00Z"
],
"timeslot_id": "6291f587-800d-4114-b3c9-9bddb08d9652",
"cost": 1.662,
"price": null,
"event": "a3829bea-77f8-46fe-af80-db02d0978783",
"bucket_id": "a03ee56d-0021-4890-8321-00ef6f990414",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-07-22T10:16:15Z",
"modified": "2019-07-22T10:16:16Z"
}
]
}
Available query params¶
Name | format | Description | Example |
---|---|---|---|
suggestions | Integer | Sets the number of suggestions that are going to be returned for the event. | suggestions=2 |
POST Event With Multiple Capacities¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/ \
-H 'apikey: {YOUR_API_KEY}' \
-d '
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": null
},
"capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null,
},
"pickup_capacity_vector": null,
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {},
"resource_event_tags": ["tag4"],
"route_event_tags": []
}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": null
},
"capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null,
},
"pickup_capacity_vector": null,
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {}
}
POST Event With Pickup Capacities¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/ \
-H 'apikey: {YOUR_API_KEY}' \
-d '
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": null
},
"capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null,
},
"pickup_capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null
},
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {}
}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": null
},
"capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null,
},
"pickup_capacity_vector": {
"capacity_1": 12.3,
"capacity_2": 3.21,
"capacity_3": null,
"capacity_4": null,
"capacity_5": null
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": ["tag4"],
"route_event_tags": []
}
POST Events In Bulk¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/bulk/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '[
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
},
{
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"address": {
"street": "Tweedestraat",
"postalcode": "2222BB",
"house_number": 2,
"city": "Dorp",
"country": "Netherlands",
"region": "Europe"
},
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
]'
[
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {}
},
{
"id": "98f407c5-250f-4a41-949d-8f10757f9ecd",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Tweedestraat",
"postalcode": "2222BB",
"house_number": 2,
"city": "Dorp",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": "2110790e-ab1a-4c93-941f-f59e335bb5b1",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}
]
CANCEL an Event¶
curl https://{root_url}/bucket-planning/v2/buckets/f9ffb566-b6f7-4c0b-b669-b5372994a1d4/events/dae6c1ea-7a95-48cc-98ea-422599f40ce6/actions/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '{"action":"cancel"}'
{
"id": "dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"algorithm_fields": {
"stop_time": 206.0,
"capacity": 23.5
},
"event_type": "delivery",
"address": {
"street": "Eerstestraat",
"postalcode": "1111AA",
"house_number": 1,
"city": "Stad",
"country": "Netherlands",
"region": "Europe"
},
"geo_point": {
"latitude": 52.010285,
"longitude": 4.375604
},
"capacity_vector": null,
"pickup_capacity_vector": null,
"min_time": "2019-07-23T05:30:00Z",
"max_time": "2019-07-23T10:00:00Z",
"sort_key": null,
"bucket": "f9ffb566-b6f7-4c0b-b669-b5372994a1d4",
"route": null,
"current_state": "planned",
"old_state": "cancelled",
"state_reason": "_/dae6c1ea-7a95-48cc-98ea-422599f40ce6",
"created": "2019-08-30T15:16:15Z",
"modified": "2019-08-30T15:16:16Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}