sharee.bike-Wiki/3.4.-pri-request=stations_available.md

73 lines
3 KiB
Markdown
Raw Normal View History

2022-01-28 12:58:48 +01:00
### request=stations_available
**request** GET of the available stations depending on the rental bike groups assigned to the registered user.
2022-01-28 12:58:48 +01:00
2022-01-28 20:53:03 +01:00
| key | Required | Format | Comment |
| ---------- | -------- | ------- | ----------------------------------- |
| authcookie | + | text>=8 | unique encrypted key OR merchant_id |
| station | o | text | station prefix+number |
2022-01-28 12:58:48 +01:00
**response** list of stations by JSON-Objects
| key | Required | Format | Comment |
| ------------- | -------- | -------- | ----------------------------------------------------- |
| state | + | text>=8 | available-state |
| description | o | text<=20 | short station description |
| gps | + | array | GPS: latitude, longitude |
| station | + | text | station prefix_number |
| station_group | + | array | station_group describes which bike_groups are allowed at the station |
2022-01-28 12:58:48 +01:00
| authed | o | text | return 1 if user is authenticated on operator |
| gps_radius | + | text | geofencing by meters around station, for bike return. |
| uri_operator | + | text | URI of operator-server |
| bike_count | + | text | Amount of available bikes on station |
2022-01-28 12:58:48 +01:00
| operator_data | o | object | operator values (see example) |
**station_group** describes which **bike_groups** are allowed at the station.
Groups are identified by ID. The following groups of bicycles are defined:
| groupID | bike type |
| ------ | ------ |
| 300101 | Cargobike |
| 300103 | Citybike |
Keep in mind, each ID is preceded by an operator-prefix.
2022-01-28 12:58:48 +01:00
Example
**REST request=stations_available** for authorized users
```
https://shareeapp-primary.example.tld/APIjsonserver?request=stations_available&authcookie=6103_0f667aa7f234fe317a2705ee89fde0c3_1234567998
2022-01-28 12:58:48 +01:00
```
2022-01-28 20:53:03 +01:00
**response** sharee JSON defaults + **response** multiple station objects
2022-01-28 12:58:48 +01:00
```
2022-01-28 20:25:57 +01:00
{
"shareejson" : {
***sharee JSON defaults***
},
2022-01-28 12:58:48 +01:00
"WUE9301" : {
"state" : "available",
"uri_operator" : "https://shareeapp-wue.example.tld",
"description" : "Cargo and Citybike Station",
2022-01-28 12:58:48 +01:00
"operator_data" : {
"operator_hours" : "Montag, Mittwoch, Freitag 9-12 Uhr",
"operator_logo" : "",
"operator_name" : "Test GmbH",
"operator_email" : "hotline@wuerzburg.demo",
"operator_phone" : "09876-122222",
"operator_color" : "#009699"
},
"station" : "WUE9301",
"station_group" : [
"WUE300101",
"WUE300103"
2022-01-28 12:58:48 +01:00
],
"gps" : {
"latitude" : "47.99814334149303",
"longitude" : " 7.765779379576922"
},
"gps_radius" : "100",
"bike_count" : "2"
2022-01-28 12:58:48 +01:00
},
2022-01-28 20:27:26 +01:00
"WUE9302" : {
...
}
2022-01-28 12:58:48 +01:00
```