sharee.bike-Wiki/5.2.-tool-request=bikes_all.md

128 lines
5.3 KiB
Markdown
Raw Normal View History

2022-01-29 11:28:50 +01:00
### request=bikes_all
**request** GET all rental bikes with the optional limitations of station and/or bike number
| key | Required | Format | Comment |
| ---------- | -------- | -------- | ------------------------------------- |
2022-01-29 13:01:25 +01:00
| authcookie | + | text | unique encrypted key |
2022-01-29 11:28:50 +01:00
| station | o | text | station prefix+number |
| bike | o | text | bike prefix+number |
**response** "bikes" by JSON-Objects
| key | Required | Format | Comment |
| -------------- | -------- | -------- | -------------------------------------- |
| state | + | text | bike available state |
2022-12-29 11:07:51 +01:00
| lock_state | + | text | smartlock locking state |
2022-01-29 11:28:50 +01:00
| service_state | o | text | service state for maintanance |
| description | o | text | short bike description |
| bike | + | text | bike prefix_number |
| gps | + | array | GPS: latitude, longitude |
| station | + | text | station prefix_number |
| bike_group | + | array | bike group, describes bike dependent fleets |
| todo_info | o | text | key if Aufgaben defined |
| system | + | text | bike lock system (BC or Ilockit) |
| uri_operator | + | text | URI of Operator-Server |
| lockit_ID | + | text | bluetooth ID |
| lockit_GUID | + | text | bluetooth GUID |
| service_code | o | array | color keys, only available for servicetool users |
2022-12-29 11:07:51 +01:00
| bike_type | + | object | describes the bike with some attributes |
| smartlock_type | + | object | (under development) describes the smartlock with some attributes |
2022-01-29 11:28:50 +01:00
2022-12-29 11:10:02 +01:00
**bike_type** JSON Object
| key | Required | Format | Comment |
| ------------------ | -------- | ---------------- | -------------------------- |
| category | o | text | "city" or "cargo" |
| wheels | o | text | "2" or "3" |
| engine | o | object | contains engine attributes like "manufacturer" |
| battery | o | object | contains bike battery attributes. "hidden=0" means not in App visible. "backend_accessible=0" means no bike charge API available |
**smartlock_type** JSON Object
| key | Required | Format | Comment |
| ------------------ | -------- | ---------------- | -------------------------- |
2022-12-30 15:39:45 +01:00
| engine | o | object | contains engine attributes like "manufacturer" |
2022-12-29 11:59:47 +01:00
| battery | o | object | contains smartlock battery attributes. Look at example response |
2022-12-29 11:10:02 +01:00
2022-01-29 11:28:50 +01:00
Example
**request** to get all bikes with states
```
2022-12-29 12:04:43 +01:00
https://shareeapp-primary.example.tld/APIjsonserver?request=bikes_all&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_23456789
2022-01-29 11:28:50 +01:00
```
**response** sharee JSON defaults + **response** multiple bike objects
```
{
"shareejson" : {
***sharee JSON defaults***
},
"bikes" : {
2022-12-29 11:59:47 +01:00
"FR4781" : {
"bike" : "FR4781",
"smartlock_type" : {
2022-12-30 15:39:45 +01:00
"engine" : {
"manufacturer" : "Ilockit"
},
2022-12-29 11:59:47 +01:00
"battery" : {
"charge_current_percent" : "37"
}
},
"system" : "Ilockit",
2022-01-29 11:28:50 +01:00
"state" : "available",
2022-12-29 11:59:47 +01:00
"station" : "FR105",
"rental_description" : {
"id" : "5533",
"reserve_timerange" : "15",
"name" : "E-Lastenrad",
"rental_info" : {
"1" : [
"Tracking",
"Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"
]
},
"tarif_elements" : {
"4" : [
"Max. Gebühr",
"24,00 € / Tag"
],
"1" : [
"Mietgebühr",
"2,00 € / 30 Min "
]
}
},
"bike_type" : {
"engine" : {
"manufacturer" : "dummy"
},
"category" : "cargo",
"wheels" : "2",
"battery" : {
"charge_current_bars" : "4",
"hidden" : "0",
"charge_current_percent" : "70",
"backend_accessible" : "0",
"charge_max_bars" : "5"
}
},
"Ilockit_ID" : "ISHAREIT-2404781",
"authed" : "1",
2022-01-29 11:28:50 +01:00
"gps" : {
2022-12-29 11:59:47 +01:00
"longitude" : "7.973855",
"latitude" : "47.927738"
2022-01-29 11:28:50 +01:00
},
2022-12-29 11:59:47 +01:00
"uri_operator" : "https://shareeapp-operator.example.tld",
2022-01-29 11:28:50 +01:00
"lock_state" : "locked",
2022-12-29 11:59:47 +01:00
"Ilockit_GUID" : "00000000-0000-0000-0000-fea583da99f8",
2022-01-29 11:28:50 +01:00
"bike_group" : [
2022-12-29 11:59:47 +01:00
"FR300101"
2022-01-29 11:28:50 +01:00
],
2022-12-29 11:59:47 +01:00
"description" : "E-Lastenrad"
2022-01-29 11:28:50 +01:00
},
"WUE5525" {
...
}
}
}
```