Update 4.1. op request=booking_request

This commit is contained in:
Rainer Gümpelein 2022-03-28 11:07:18 +00:00
parent d005e266b7
commit 19ce839115

View file

@ -1,11 +1,11 @@
### request=booking_request
**request** PUSH rental bike reservation with Ilockit values as return value.
**request** POST bike reservation.
| key | Required | Format | Comment |
| ---------- | ----------- | -------- | ---------------------------- |
| authcookie | + | text | unique encrypted key |
| bike | + | text | bike prefix+number for booking |
| bike | + | text | bike prefix+number |
**response** like **request=user_bikes_occupied** with "bikes_occupied" JSON-Objects
@ -60,3 +60,65 @@ https://shareeapp-fr01.copri-bike.de/APIjsonserver?request=booking_request&bike=
}
}
```
**request** POST bike reservation with incl. booking all at once.
| key | Required | Format | Comment |
| ---------- | ----------- | -------- | ---------------------------- |
| authcookie | + | text | unique encrypted key |
| bike | + | text | bike prefix+number |
| state | + | text | on rental start state=occupied |
| lock_state | + | text | on rental start lock_state=unlocking (BLE unlocked) |
| station_state | o | text | on rental start station_lock=unlocking (BLE unlocked) |
**response** like **request=user_bikes_occupied** with "bikes_occupied" JSON-Objects
Example
**REST request=booking_request** from authorized users
```
https://shareeapp-fr01.copri-bike.de/APIjsonserver?request=booking_request&bike=1006&state=occupied&lock_state=unlocking&station_state=unlocking&authcookie=1b2771663e0b7eb3519ab0_12345678
```
**response** sharee JSON defaults + **response** multiple bikes_occupied objects
```
{
"shareejson" : {
***sharee JSON defaults***
},
"bikes_occupied" : {
"155898" : {
"bike" : "FR1006",
"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",
"end_time" : "2021-10-28 20:08:15",
"station" : "FR101",
"lock_state" : "unlocking",
"station_state" : "unlocking",
"description" : "Vauban-bike",
"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" : "sigo",
"real_hours" : "0.0333333333333333",
"bike_group" : [
"FR300001"
]
},
"155899" : {
...
}
}
```