parent
2032cccd03
commit
be0eae182a
61
doc/api.md
Normal file
61
doc/api.md
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
# Api documentation
|
||||
|
||||
REST Api documentation
|
||||
|
||||
## Mapobjects
|
||||
|
||||
Query for `bones` / `poi`/ `shop` / etc
|
||||
|
||||
* **Path:** `api/mapobjects`
|
||||
* **Method:** `POST`
|
||||
* **Consumes:** `application/json`
|
||||
* **Produces:** `application/json`
|
||||
|
||||
POST-Payload:
|
||||
```json
|
||||
{
|
||||
"pos1": {
|
||||
"x":-2048,
|
||||
"y":-2048,
|
||||
"z":-2048
|
||||
},
|
||||
"pos2": {
|
||||
"x":2048,
|
||||
"y":2048,
|
||||
"z":2048
|
||||
},
|
||||
"type":"bones"
|
||||
}
|
||||
```
|
||||
|
||||
**Note**: `pos1` and `pos2` are in mapblocks
|
||||
|
||||
|
||||
Example query:
|
||||
```bash
|
||||
curl 'http://127.0.0.1:8080/api/mapobjects/' \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
--data '{"pos1":{"x":-2048,"y":-2048,"z":-2048},"pos2":{"x":2048,"y":2048,"z":2048},"type":"bones"}' \
|
||||
| jq
|
||||
```
|
||||
|
||||
Result:
|
||||
```json
|
||||
[{
|
||||
"mapblock": {
|
||||
"x": -1671,
|
||||
"y": 0,
|
||||
"z": -82
|
||||
},
|
||||
"x": -26729,
|
||||
"y": 1,
|
||||
"z": -1306,
|
||||
"type": "bones",
|
||||
"mtime": 1554099532,
|
||||
"attributes": {
|
||||
"owner": "Brzezowski58",
|
||||
"time": "0"
|
||||
}
|
||||
}]
|
||||
```
|
@ -33,6 +33,7 @@ Demo: [Pandorabox Server map](https://pandorabox.io/map/#-1782.25/493.5/10)
|
||||
* [Configuration](doc/config.md)
|
||||
* [Recommended specs](doc/recommended_specs.md)
|
||||
* [Stats webfragment](doc/stats_webfragment.md)
|
||||
* [Web API](doc/api.md)
|
||||
* [Contribution](doc/contrib.md)
|
||||
* [Development](doc/dev.md)
|
||||
* [License](doc/license.md)
|
||||
|
Loading…
Reference in New Issue
Block a user