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

111 lines
2.6 KiB
Plaintext

### GET Ranks [GET /ranks{?q,fractFilter}]
List all ranks
+ Parameters
+ q: `Gefr` (string, optional) - filter string which filters for partial rank name
+ fractFilter: `BLUFOR` (enum[string], optional)
Field to filter by fraction
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ Response 200
+ Attributes (array[Rank], fixed-type)
### GET Rank [GET /ranks/{id}]
Retrieve single rank data
+ Parameters
+ id: `5aba5504eadcce6332c6a775` (string, required) - unique id of the rank to fetch
+ Response 200
+ Attributes (Rank, fixed-type)
### Create Rank [POST /ranks]
Create a new rank
+ 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--
+ Response 201
+ Attributes (Rank, fixed-type)
### Update Rank [PATCH /ranks/{id}]
Update rank, identified by its id
+ 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--
+ Response 200
+ Attributes (Rank, fixed-type)
### Delete Rank [DELETE /ranks/{id}]
Delete a rank
+ Parameters
+ id: `5abeb1b995cf43205225710a` (string, required) - unique id of the rank
+ Response 204