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

94 lines
2.1 KiB
Plaintext

### List Users [GET /users{?q,fractFilter,limit,offset}]
Get single army member information
+ Parameters
+ q: `hardi` (string, optional) - filter string which filters for partial username
+ fractFilter: `BLUFOR` (enum[string], optional)
Field to filter by fraction
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `GLOBAL`
+ limit: 20 (number, optional)
Maximum number of users to return
+ Default: Infinity
+ offset: 0 (number, optional)
Offset into result-set (useful for pagination)
+ Default: 0
+ Response 200 (application/json; charset=utf-8)
+ Headers
X-Total-Count: 1
+ Attributes (array[UserPopulated], fixed-type)
### Get User [GET /users/{id}]
Get single army member information
+ Parameters
+ id: `5ab68d42f547ed304064e5f7` (string, required) - unique id of army-member
+ Response 200 (application/json; charset=utf-8)
+ Attributes (UserPopulated, fixed-type)
### Create User [POST /users]
Create a new army member
**Permission: 2**
+ Request (application/json)
+ Attributes
+ username: `[GNC]Paolo` (string, required) - display name of the user
+ Response 201 (application/json; charset=utf-8)
+ Attributes (UserInclTimestamp, fixed-type)
### Update User [PUT /users/{id}]
Update an army member, identified by its id
**Permission: 2**
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ Request (application/json)
+ 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
+ Response 200 (application/json; charset=utf-8)
+ Attributes (User, fixed-type)
### Delete User [DELETE /users/{id}]
Delete an army member
**Permission: 2**
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ Response 204