opt-cc/api/apib/army-management/ranks.apib

117 lines
2.8 KiB
Plaintext
Raw Normal View History

2018-04-01 15:12:24 +02:00
### List Ranks [GET /ranks{?q,fractFilter}]
2018-03-29 17:13:55 +02:00
List all ranks
+ Parameters
2018-03-29 17:55:31 +02:00
+ q: `Gefr` (string, optional) - filter string which filters for partial rank name
2018-03-29 17:13:55 +02:00
2018-03-29 22:14:04 +02:00
+ fractFilter: `BLUFOR` (enum[string], optional)
2018-03-29 17:13:55 +02:00
Field to filter by fraction
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-29 17:13:55 +02:00
2018-03-29 22:14:04 +02:00
+ Attributes (array[Rank], fixed-type)
2018-04-01 15:12:24 +02:00
### Get Rank [GET /ranks/{id}]
2018-03-29 22:14:04 +02:00
Retrieve single rank data
+ Parameters
+ id: `5aba5504eadcce6332c6a775` (string, required) - unique id of the rank to fetch
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-29 22:14:04 +02:00
+ Attributes (Rank, fixed-type)
2018-03-31 00:14:30 +02:00
### Create Rank [POST /ranks]
Create a new rank
**Permission: 2**
2018-03-31 00:14:30 +02:00
+ Request (multipart/form-data; boundary=---BOUNDARY)
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain
Obergefreiter
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain
BLUFOR
-----BOUNDARY
Content-Disposition: form-data; name="level"
Content-Type: text/plain
2
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
2018-04-01 15:12:24 +02:00
+ Response 201 (application/json; charset=utf-8)
2018-03-31 00:14:30 +02:00
+ Attributes (Rank, fixed-type)
### Update Rank [PATCH /ranks/{id}]
Update rank, identified by its id
**Permission: 2**
2018-03-31 00:14:30 +02:00
+ Parameters
+ id: `5abeb23995cf43205225710b` (string, required) - unique id of the rank
+ Request (multipart/form-data; boundary=---BOUNDARY)
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain
Stabsunteroffizier
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain
BLUFOR
-----BOUNDARY
Content-Disposition: form-data; name="level"
Content-Type: text/plain
10
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA
QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=
-----BOUNDARY--
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-31 00:14:30 +02:00
+ Attributes (Rank, fixed-type)
### Delete Rank [DELETE /ranks/{id}]
Delete a rank
**Permission: 2**
2018-03-31 00:14:30 +02:00
+ Parameters
+ id: `5abeb1b995cf43205225710a` (string, required) - unique id of the rank
+ Response 204