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

88 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-03-29 22:14:04 +02:00
### Get 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
+ Response 200
+ Headers
X-Total-Count: 1
+ Attributes (array[User], 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-03-19 20:32:59 +01:00
+ Response 200
+ Attributes (User, fixed-type)
2018-03-29 22:14:04 +02:00
### Create User [POST /users]
Create a new army member
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
+ Response 201
+ Attributes (User, fixed-type)
### Update User [PUT /users/{id}]
Update an army member, identified by its id
+ 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
+ Response 200
+ Attributes (User, fixed-type)
### Delete User [DELETE /users/{id}]
Delete an army member
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ Response 204