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

94 lines
2.1 KiB
Plaintext
Raw Normal View History

2018-04-01 15:12:24 +02:00
### List Users [GET /users{?q,fractFilter,limit,offset}]
2018-03-25 21:18:13 +02:00
Get single army member information
+ Parameters
+ q: `hardi` (string, optional) - filter string which filters for partial username
2018-03-29 22:14:04 +02:00
+ fractFilter: `BLUFOR` (enum[string], optional)
2018-03-25 21:18:13 +02:00
Field to filter by fraction
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ limit: 20 (number, optional)
Maximum number of users to return
+ Default: Infinity
2018-03-29 22:14:04 +02:00
+ offset: 0 (number, optional)
2018-03-25 21:18:13 +02:00
Offset into result-set (useful for pagination)
+ Default: 0
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-25 21:18:13 +02:00
+ Headers
X-Total-Count: 1
2018-04-01 15:12:24 +02:00
+ Attributes (array[UserPopulated], fixed-type)
2018-03-25 21:18:13 +02:00
2018-03-29 22:14:04 +02:00
### Get User [GET /users/{id}]
2018-03-19 20:32:59 +01:00
Get single army member information
+ Parameters
+ id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of army-member
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-19 20:32:59 +01:00
2018-04-01 15:12:24 +02:00
+ Attributes (UserPopulated, fixed-type)
2018-03-29 22:14:04 +02:00
### Create User [POST /users]
Create a new army member
**Permission: 2**
2018-03-30 12:53:49 +02:00
+ Request (application/json)
2018-03-29 22:14:04 +02:00
+ Attributes
+ username: `[GNC]Paolo` (string, required) - display name of the user
2018-04-01 15:12:24 +02:00
+ Response 201 (application/json; charset=utf-8)
2018-03-29 22:14:04 +02:00
2018-04-01 15:12:24 +02:00
+ Attributes (UserInclTimestamp, fixed-type)
2018-03-29 22:14:04 +02:00
### Update User [PUT /users/{id}]
Update an army member, identified by its id
**Permission: 2**
2018-03-29 22:14:04 +02:00
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
2018-03-30 12:53:49 +02:00
+ Request (application/json)
2018-03-29 22:14:04 +02:00
+ Attributes
+ _id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ username: `Paolo` (string, optional) - display name of the user
+ rankLvl: 22 (number, optional) - rank level representing the rank
+ squadId: `591470249e9fae286e008e31` (string, optional) - squadId of squad which army member is part of
2018-04-01 15:12:24 +02:00
+ Response 200 (application/json; charset=utf-8)
2018-03-29 22:14:04 +02:00
+ Attributes (User, fixed-type)
### Delete User [DELETE /users/{id}]
Delete an army member
**Permission: 2**
2018-03-29 22:14:04 +02:00
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ Response 204