mirror of
https://gitlab.com/t6353/sharee.bike.wiki.git
synced 2024-11-13 22:16:30 +01:00
5 KiB
5 KiB
request=user_bikes_occupied
Query of the reserved and booked bikes. This request is called implicitly after "booking_request" and "booking_update" and provides a list of the reserved and/or booked rental bikes. In addition, the current real-time rental costs are determined for ongoing rentals.
key | Required | Format | Comment |
---|---|---|---|
authcookie | + | text | unique encrypted key |
response "bikes_occupied" bikes by JSON-Objects, on default all smartlock key values are new generated
key | Required | Format | Comment |
---|---|---|---|
bike | + | text | bike prefix+number |
system | + | text | Ilockit |
description | o | text<=20 | short bike description |
gps | + | array | last logged GPS: latitude, longitude |
station | + | text | last logged bike station prefix_number |
request_time | + | date time | ISO 8601 booking-request timestamp |
start_time | + | date time | ISO 8601 booking-start timestam |
end_time | + | date time | ISO 8601 booking-end or now timestamp |
bike_group | + | array | bike_group |
tariff_description | o | object | Tariff description |
real_hours | + | text | on request real rental-hours |
computed_hours | + | text | on request tariff-computed rental-hours |
unit_price | + | text | Tariff base unit-price |
total_price | + | text | on request tariff-computed total rental-price |
Ilockit_ID (if Ilockit) | + | text | Ilockit bluetooth ID |
Ilockit_GUID (if Ilockit) | o | text | Ilockit internal bluetooth GUID |
K_seed (if Ilockit) | + | array=16 * 8-bit | random key |
K_u (if Ilockit) | + | array=24 * 8-bit | user key |
state | + | text | canceled OR occupied OR available. On success, state response value must be identical as state request value |
lock_state | + | text | lock_state: locking OR locked OR unlocked. On success, lock_state response value must be identical as lock_state request value |
station_state | + | text | station smartlock locking state |
service_state | o | text | service state for maintanance |
bike_charge | o | text | bike akku capacity |
geo_distance | + | text | geofencing meters between users GPS and next station GPS. geo_distance must be <= geo_radius defined by stations |
Example REST request=user_bikes_occupied for authorized users
https://shareeapp-primary.copri-bike.de/APIjsonserver?request=user_bikes_occupied&authcookie=6103_7dc3c95028d06c9663378f6d44346de7_12345678
response sharee JSON defaults + response multiple bikes_occupied objects
{
"shareejson" : {
***sharee JSON defaults***
},
"bikes_occupied" : {
"155898" : {
"bike" : "FR1540",
"total_price" : "0.00",
"gps" : {
"longitude" : "7.825490",
"latitude" : "47.976634"
},
"tariff_description" : {
"number" : "5504",
"free_hours" : "1.00",
"eur_per_hour" : "2.00",
"name" : "Vauban Bonus",
"max_eur_per_day" : "15.00"
},
"state" : "occupied",
"Ilockit_ID" : "ISHAREIT-2200540",
"end_time" : "2021-10-28 20:08:15",
"station" : "FR101",
"Ilockit_GUID" : "00000000-0000-0000-0000-fc3c002a2add",
"lock_state" : "unlocked",
"description" : "Vauban-bike (Ilockit)",
"request_time" : "2021-10-28 20:03:29.231426+02",
"start_time" : "2021-10-28 20:06:36.412847+02",
"unit_price" : "2.00",
"uri_operator" : "https://shareeapp-fr01.copri-bike.de",
"computed_hours" : "0",
"system" : "Ilockit",
"real_hours" : "0.0333333333333333",
"K_u" : "[-66, 27, -35, 67, -62, 67, 53, 84, -71, 54, -119, 13, 86, -19, 35, -23, -61, 7, 105, -92, 0, 0, 0, 0]",
"K_seed" : "[110, -106, -90, -65, 90, 47, 25, -112, -8, -115, 109, -69, 108, 56, -77, 88]",
"bike_group" : [
"FR300001"
]
},
"155899" : {
...
}
}