Update 5.3. tool request=service_done

This commit is contained in:
Rainer Gümpelein 2023-01-05 11:04:31 +00:00
parent 9ecffdae3b
commit 23d2035f3e

View file

@ -1,57 +1,76 @@
### request=service_done
**request** Insert and/or update services by **bike** OR **station** prefix+number
| key | Required | Format | Comment |
| ---------- | -------- | -------- | ------------------------------------- |
| authcookie | + | text | unique encrypted key |
| bike | o/+ | text | bike prefix+number |
| station | o/+ | text | station prefix+number |
| work_id | + | text | datafield-key must be selected from DB template |
| work_val | + | text | Value for data-key defined by work_id |
**request** Insert and/or update services by **bike** OR **station** prefix+number
| key | Required | Format | Comment |
|-----|----------|--------|---------|
| authcookie | + | text | unique encrypted key |
| bike | o/+ | text | bike prefix+number |
| station | o/+ | text | station prefix+number |
| work_id | + | text | datafield-key must be selected from DB template |
| work_val | + | text | Value for data-key defined by work_id |
| service_id | o | text | update task (Aufgabe) by service_id, else last open entry will be used |
| new_task | o | text | insert new task (Aufgabe) |
**response** "bike- OR station-number" with work-values by JSON-Objects
Parameter | Required | Format | Comment |
| -------------- | -------- | -------- | -------------------------------------- |
| work_id | + | text | internal data key |
| work_name | + | text | name of datafield |
| work_val | + | text | data value |
| service_id | + | text | internal dataset id |
| service_type | + | text | hart=1, weich=0 |
| interval | + | text | Service interval in days |
| time_over | + | text | time_over=1 if service_interval exceeded |
| mtime | + | date time| ISO 8601 last service timestamp |
| owner | + | text | service-user by ID |
| user_name | + | text | service-user by user name |
| Parameter | Required | Format | Comment |
|-----------|----------|--------|---------|
| work_id | + | text | internal data key |
| work_name | + | text | name of datafield |
| work_val | + | text | data value |
| service_id | + | text | internal dataset id |
| service_type | + | text | hart=1, weich=0 |
| interval | + | text | Service interval in days |
| time_over | + | text | time_over=1 if service_interval exceeded |
| mtime | + | date time | ISO 8601 last service timestamp |
| owner | + | text | service-user by ID |
| user_name | + | text | service-user by user name |
Example **REST request** insert/update work_id with work_val
Example
**REST request** insert/update work_id with work_val
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=int01&work_val=1&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
Example **REST request** insert new task
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&new_task=1&work_id=txt01&work_val=Neue Aufgabe&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**REST request** update "Aufgaben" by service_id
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=txt01&work_val=%3A%3Aerledigt%3A%3A&service_id=41519&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**REST request** update bike for redistribution to another station
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=station&work_val=FR101&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**REST request** update bike state to available OR maintanance OR defect
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=state&work_val=maintanance&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**REST request** update bike for bike_battery_charge
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=bike_battery_charge&work_val=100&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**REST request** update bike for smartlock_battery_charge
```
https://shareeapp-operator.example.tld/APIjsonserver?request=service_done&bike=FR1541&work_id=smartlock_battery_charge&work_val=100&authcookie=6103_f782a208d9399291ba8d086b5dcc2509_34567890
```
**response** returns last bike/station service-work values by JSON-Objects depending on *bike* OR *station* number
**response** returns last bike/station service-work values by JSON-Objects depending on _bike_ OR _station_ number
```
{