Back to top

Operation Pandora Trigger Command Center API Documentation

General Introduction

Location

The API can only be accessed via HTTPS in the cloud instance.

You can reach the API for the cloud instance at

https://cc.noarch.de/api/

Local installations can access the API using the respective domain with the path /api/ appended.

So if your server is reachable at https://cc.myserver.lan the API endpoint is located at

# Note: `/api/` is appended to the locale installation server url

https://cc.myserver.lan/api/

Authentication

Requests to most of the API endpoints have to be authenticated using an API token which is received after successfully providing your application credentials to the API.

Once acquired the token has to be provided in the X-Access-Token header of every request that requires authentication.

The following example illustrates how to provide the token when using curl

# via Authorization header

> curl -H "X-Access-Token: $CC_API_TOKEN" <API_RESOURCE_PATH_GOES_HERE>

Permission Levels

The permission level is resolved by the API token you send, which resolves the specific app user information.

Endpoints that require a certain permission level to be accessed, mention the minimum required permission level in the description.

Permission Levels:

0 - User

1 - Squadlead

2 - High Command

3 - Maintainer

4 - Administrator

Timezones & Date Format

Date Format

In general the API returns and expects dates & times in the ISO 8601 format. For example: 2017-02-27T17:05:33.155Z for a time or 2017-02-27 for a date.

Timezone

The default timezone returned will be the UTC timezone

File Resources

The running express server instance saves entity related files like squad logos and statistic logs on the file system. In the original MEAN application they are served in the /resource path of the application server.

The following examples show where those files are located, to be accessed on the cloud instance.

Images

Decoration Image

https://cc.noarch.de/resource/decoration/{decorationId}.png

Rank Image

https://cc.noarch.de/resource/rank/{rankId}.png

Signature Image

https://cc.noarch.de/resource/signature/{userId}.png

Squad Logo

https://cc.noarch.de/resource/squad/{squadId}.png

Log-Files

Sanitized Log File

https://cc.noarch.de/resource/logs/{warId}/clean.log

Original Uploaded Log File

https://cc.noarch.de/resource/logs/{warId}/war.log

Access

Endpoints

Sign up - Create account
POST/authenticate/signup

Create a new application user account.

Example URI

POST /authenticate/signup
Request  Create Account
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "kallek",
  "password": "password",
  "secret": "random secret text"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "description": "the username of the app-user"
    },
    "password": {
      "type": "string",
      "description": "password of the app-user"
    },
    "secret": {
      "type": "string",
      "description": "secret used for sign-up identification in connection with board usage"
    }
  },
  "required": [
    "username",
    "password",
    "secret"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "message": "User successfully created"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}

Login - Generate Token
POST/authenticate

Generate a token which can be used to make API requests.

Example URI

POST /authenticate
Request  Generate Token
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "testuser",
  "password": "password"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "description": "username of the app-user"
    },
    "password": {
      "type": "string",
      "description": "password of the app-user"
    }
  },
  "required": [
    "username",
    "password"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "593d632772d35225232bcabb",
  "username": "kallek",
  "permission": 3,
  "squad": {
    "_id": "591470249e9fae286e008e31",
    "sortingNumber": 30,
    "updatedAt": "2017-05-31T20:43:07.165Z",
    "timestamp": "2017-05-11T14:07:32.471Z",
    "name": "Alpha",
    "fraction": "BLUFOR",
    "__v": 2
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1OTNkNWUzZjcyZDM1MjI1MjIyYmNhYmEiLCJpYXQiOjE1MjEzOTQ5NDYsImV4cCI6MTUyMzgxNDE0Nn0.vOAwA5--qrx8BglhyGZWVYx7LeuRKOHH0NQXmHFNhIQ",
  "tokenExpireDate": "2018-04-15T17:42:25.050Z"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the app-user"
    },
    "username": {
      "type": "string",
      "description": "the username of the app-user"
    },
    "permission": {
      "type": "number",
      "description": "the permission level of the app-user (0 - user, 1 - sql, 2 - hl, 3 - maintainer, 4 - admin)"
    },
    "squad": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "the unique id of the squad"
        },
        "sortingNumber": {
          "type": "number",
          "description": "the number for orders in lists of squads"
        },
        "updatedAt": {
          "type": "string",
          "description": "version timestamp"
        },
        "timestamp": {
          "type": "string",
          "description": "creation timestamp"
        },
        "name": {
          "type": "string",
          "description": "display name of the squad"
        },
        "fraction": {
          "type": "string",
          "description": "fraction the squad is part of"
        },
        "__v": {
          "type": "number",
          "description": "version number"
        }
      },
      "required": [
        "_id",
        "sortingNumber",
        "updatedAt",
        "timestamp",
        "name",
        "fraction",
        "__v"
      ],
      "description": "squad the app-user is member of"
    },
    "token": {
      "type": "string",
      "description": "generated access token"
    },
    "tokenExpireDate": {
      "type": "string",
      "description": "expiration date of the token"
    }
  },
  "required": [
    "_id",
    "username",
    "permission",
    "squad",
    "token",
    "tokenExpireDate"
  ]
}

Admin

Account

List App Users
GET/account

List all app users, ordered by username

Permission: 4

Example URI

GET /account
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "5abf5064861d950f157c4a09",
    "username": "hardiready",
    "squad": {
      "_id": "591470249e9fae286e008e31",
      "sortingNumber": 30,
      "updatedAt": "2017-05-31T20:43:07.165Z",
      "timestamp": "2017-05-11T14:07:32.471Z",
      "name": "Alpha",
      "fraction": "BLUFOR",
      "__v": 2
    },
    "activated": true,
    "password": "$1s23$1$H7dl7RTFZUBIBNUZ213IIOUasdNEI571sMuzXmzi4",
    "permission": 1,
    "secret": "I like tacos",
    "timestamp": "2017-08-02T07:48:56.378Z",
    "updatedAt": "2017-08-02T08:07:20.929Z",
    "__v": 3
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the app user"
      },
      "username": {
        "type": "string",
        "description": "username of the app user"
      },
      "squad": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "_id": {
            "type": "string",
            "description": "the unique id of the squad"
          },
          "sortingNumber": {
            "type": "number",
            "description": "the number for orders in lists of squads"
          },
          "updatedAt": {
            "type": "string",
            "description": "version timestamp"
          },
          "timestamp": {
            "type": "string",
            "description": "creation timestamp"
          },
          "name": {
            "type": "string",
            "description": "display name of the squad"
          },
          "fraction": {
            "type": "string",
            "description": "fraction the squad is part of"
          },
          "__v": {
            "type": "number",
            "description": "version number"
          }
        },
        "required": [
          "_id",
          "sortingNumber",
          "updatedAt",
          "timestamp",
          "name",
          "fraction",
          "__v"
        ],
        "description": "squad the app user is responsible for"
      },
      "activated": {
        "type": "boolean",
        "description": "account activation status"
      },
      "password": {
        "type": "string",
        "description": "password hash value"
      },
      "permission": {
        "type": "number",
        "description": "permission level"
      },
      "secret": {
        "type": "string",
        "description": "secret used for account activation comparison"
      },
      "timestamp": {
        "type": "string",
        "description": "creation timestamp"
      },
      "updatedAt": {
        "type": "string",
        "description": "version timestamp"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "username",
      "squad",
      "activated",
      "password",
      "permission",
      "secret",
      "timestamp",
      "updatedAt",
      "__v"
    ]
  }
}

Update App User
PATCH/account/{id}

Update an app user, identified by its id

Permission: 4

Example URI

PATCH /account/5abf5064861d950f157c4a09
URI Parameters
HideShow
id
string (required) Example: 5abf5064861d950f157c4a09

unique id of app user

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "5abf5064861d950f157c4a09",
  "username": "hardiready",
  "squad": "5abe166f8b7488392a623f12",
  "activated": true,
  "password": "$1s23$1$H7dl7RTFZUBIBNUZ213IIOUasdNEI571sMuzXmzi4",
  "permission": 1,
  "secret": "I like tacos"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the app user"
    },
    "username": {
      "type": "string",
      "description": "username of the app user"
    },
    "squad": {
      "type": "string",
      "description": "id of squad the app user is responsible for"
    },
    "activated": {
      "type": "boolean",
      "description": "account activation status"
    },
    "password": {
      "type": "string",
      "description": "password hash value"
    },
    "permission": {
      "type": "number",
      "description": "permission level"
    },
    "secret": {
      "type": "string",
      "description": "secret used for account activation comparison"
    }
  },
  "required": [
    "_id",
    "username"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5abf5064861d950f157c4a09",
  "username": "hardiready",
  "squad": {
    "_id": "591470249e9fae286e008e31",
    "sortingNumber": 30,
    "updatedAt": "2017-05-31T20:43:07.165Z",
    "timestamp": "2017-05-11T14:07:32.471Z",
    "name": "Alpha",
    "fraction": "BLUFOR",
    "__v": 2
  },
  "activated": true,
  "password": "$1s23$1$H7dl7RTFZUBIBNUZ213IIOUasdNEI571sMuzXmzi4",
  "permission": 1,
  "secret": "I like tacos",
  "timestamp": "2017-08-02T07:48:56.378Z",
  "updatedAt": "2017-08-02T08:07:20.929Z",
  "__v": 3
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the app user"
    },
    "username": {
      "type": "string",
      "description": "username of the app user"
    },
    "squad": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "_id": {
          "type": "string",
          "description": "the unique id of the squad"
        },
        "sortingNumber": {
          "type": "number",
          "description": "the number for orders in lists of squads"
        },
        "updatedAt": {
          "type": "string",
          "description": "version timestamp"
        },
        "timestamp": {
          "type": "string",
          "description": "creation timestamp"
        },
        "name": {
          "type": "string",
          "description": "display name of the squad"
        },
        "fraction": {
          "type": "string",
          "description": "fraction the squad is part of"
        },
        "__v": {
          "type": "number",
          "description": "version number"
        }
      },
      "required": [
        "_id",
        "sortingNumber",
        "updatedAt",
        "timestamp",
        "name",
        "fraction",
        "__v"
      ],
      "description": "squad the app user is responsible for"
    },
    "activated": {
      "type": "boolean",
      "description": "account activation status"
    },
    "password": {
      "type": "string",
      "description": "password hash value"
    },
    "permission": {
      "type": "number",
      "description": "permission level"
    },
    "secret": {
      "type": "string",
      "description": "secret used for account activation comparison"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "username",
    "squad",
    "activated",
    "password",
    "permission",
    "secret",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Delete App User
DELETE/account/{id}

Permission: 4

Delete an app user

Example URI

DELETE /account/5ac0de67b5edc7771c027b94
URI Parameters
HideShow
id
string (required) Example: 5ac0de67b5edc7771c027b94

unique id of app user

Response  204

Commands

Update signature image
POST/cmd/createSignature/{userId}

Update an army members signature image

Permission: 4

Example URI

POST /cmd/createSignature/5ab68d42f547ed304064e5f7
URI Parameters
HideShow
userId
string (required) Example: 5ab68d42f547ed304064e5f7

army members unique user id

Request
HideShow
Headers
Content-Type: application/json
Body
{}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {}
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "status": "success"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "action result message"
    }
  },
  "required": [
    "status"
  ]
}

Army Management

Army

Get Army Overview
GET/overview

Get bundled army, squad and member data for the participating fractions

Example URI

GET /overview
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "squads": [
      {
        "_id": "59146e6aef2ad810623ed519",
        "name": "Führungsstab",
        "members": [
          {
            "_id": "5918d2ca574b0b16820a0b28",
            "username": "Jagernaut",
            "rank": "General"
          }
        ],
        "memberCount": 1
      }
    ],
    "memberCount": 1
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Awardings

Get Awardings
GET/awardings{?userId,inProgress,fractFilter,squadId}

List all awardings

Example URI

GET /awardings?userId=5ab68d42f547ed304064e5f7&inProgress=false&fractFilter=BLUFOR&squadId=5aba54eaeadcce6332c6a774
URI Parameters
HideShow
userId
string (optional) Example: 5ab68d42f547ed304064e5f7

specific army member Id to show the awardings for

inProgress
boolean (optional) Default: false Example: false

true to filter by awarding state ‘in progress’

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

squadId
string (optional) Example: 5aba54eaeadcce6332c6a774

unique id of the squad

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "591ca81c1ee62711cfc19002",
    "confirmed": 1,
    "date": "2017-05-17T19:44:24.926Z",
    "decorationId": {
      "_id": "591c81981ee62711cfc18f4a",
      "description": "Verliehen an alle Teilnehmer der ArmA3-Kampagne \"Sturm über der Ägäis\" im Jahr 2016",
      "fraction": "GLOBAL",
      "isMedal": false,
      "name": "OPT4 pt.1 - \"Sturm über der Ägäis\"",
      "sortingNumber": 10,
      "timestamp": "2017-05-17T17:00:08.684Z",
      "updatedAt": "2018-01-13T09:57:50.827Z",
      "__v": 2
    },
    "reason": "war dabei",
    "proposer": {
      "_id": "5abf5064861d950f157c4a09",
      "username": "hardiready",
      "squad": "591470249e9fae286e308e41"
    },
    "timestamp": "2017-05-17T19:44:28.751Z",
    "updatedAt": "\"2017-05-17T19:44:28.751Z",
    "userId": {
      "_id": "5ab68d42f547ed304064e5f7",
      "username": "Jagernaut",
      "rankLvl": 22,
      "squadId": "591470249e9fae286e008e31",
      "updatedAt": "2018-02-24T01:01:25.825Z",
      "__v": 35
    },
    "__v": 0
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the awarding"
      },
      "confirmed": {
        "type": "number",
        "description": "status of the awarding request (0 - in progress, 1 - approved, 2 - rejected)"
      },
      "date": {
        "type": "string",
        "description": "date when the awarding was requested"
      },
      "decorationId": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "unique id of the decoration"
          },
          "description": {
            "type": "string",
            "description": "description expressing what the decoration should be given for"
          },
          "fraction": {
            "type": "string",
            "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
          },
          "isMedal": {
            "type": "boolean",
            "description": "show if decoration is medal or ribbon"
          },
          "name": {
            "type": "string",
            "description": "display name of the decoration"
          },
          "sortingNumber": {
            "type": "number",
            "description": "sorting number for lists"
          },
          "timestamp": {
            "type": "string",
            "description": "creation timestamp"
          },
          "updatedAt": {
            "type": "string",
            "description": "version timestamp"
          },
          "__v": {
            "type": "number",
            "description": "version number"
          }
        },
        "required": [
          "_id",
          "description",
          "fraction",
          "isMedal",
          "name",
          "sortingNumber",
          "timestamp",
          "updatedAt",
          "__v"
        ],
        "description": "populated decoration object that is given with the awarding"
      },
      "reason": {
        "type": "string",
        "description": "reason for giving the awarding"
      },
      "proposer": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "unique id of the app user"
          },
          "username": {
            "type": "string",
            "description": "username of the app user"
          },
          "squad": {
            "type": "string",
            "description": "squad id associated with the app user"
          }
        },
        "required": [
          "_id",
          "username",
          "squad"
        ],
        "description": "app user who requested this awarding"
      },
      "timestamp": {
        "type": "string",
        "description": "creation date"
      },
      "updatedAt": {
        "type": "string",
        "description": "version date"
      },
      "userId": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "unique id of the army member"
          },
          "username": {
            "type": "string",
            "description": "the displayed username of the army member"
          },
          "rankLvl": {
            "type": "number",
            "description": "rank level representing the rank"
          },
          "squadId": {
            "type": [
              "string",
              "null"
            ],
            "description": "id of squad which the army member is part of"
          },
          "updatedAt": {
            "type": "string",
            "description": "the version timestamp"
          },
          "__v": {
            "type": "number",
            "description": "the version number of the object"
          }
        },
        "required": [
          "_id",
          "username",
          "rankLvl",
          "squadId",
          "__v"
        ],
        "description": "populated user who gets this awarding"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "confirmed",
      "date",
      "decorationId",
      "reason",
      "proposer",
      "timestamp",
      "updatedAt",
      "userId",
      "__v"
    ]
  }
}

Create Awarding
POST/awardings

Create a new awarding which is immediatly assigned to the user

Permission: 2

Example URI

POST /awardings
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "userId": "5ab68d42f547ed304064e5f7",
  "decorationId": "5abd3dff6e6a0334d95b8ba0",
  "reason": "Good boy",
  "proposer": "5ab68ceef547ed304064e5f6"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "description": "unique id of the army member to give award"
    },
    "decorationId": {
      "type": "string",
      "description": "unique id of the decoration"
    },
    "reason": {
      "type": "string",
      "description": "reason for giving the awarding"
    },
    "proposer": {
      "type": "string",
      "description": "app user id, who requested this awarding"
    }
  },
  "required": [
    "userId",
    "decorationId",
    "reason",
    "proposer"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591ca81c1ee62711cfc19002",
  "confirmed": 1,
  "date": "2017-05-17T19:44:24.926Z",
  "decorationId": "591c81981ee62711cfc18f4a",
  "reason": "war dabei",
  "proposer": "593d5e3f72d35225222bcaba",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "userId": "5918d2ca574b0b1d820a0b24",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the awarding"
    },
    "confirmed": {
      "type": "number",
      "description": "status of the awarding request (0 - in progress, 1 - approved, 2 - rejected)"
    },
    "date": {
      "type": "string",
      "description": "date when the awarding was requested"
    },
    "decorationId": {
      "type": "string",
      "description": "id of decoration that is given with the awarding"
    },
    "reason": {
      "type": "string",
      "description": "reason for giving the awarding"
    },
    "proposer": {
      "type": "string",
      "description": "id of app user who requested this awarding"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "userId": {
      "type": "string",
      "description": "the unique id of the user who got this awarding"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "confirmed",
    "date",
    "decorationId",
    "reason",
    "proposer",
    "timestamp",
    "updatedAt",
    "userId",
    "__v"
  ],
  "additionalProperties": false
}

Create Awarding Proposal
POST/request/award

Create a new awarding proposal, that needs to be approved by higher permission level user to take effect

Permission: 1

Example URI

POST /request/award
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "userId": "5ab68d42f547ed304064e5f7",
  "decorationId": "5abd3dff6e6a0334d95b8ba0",
  "reason": "Good boy"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "description": "unique id of the army member to give award"
    },
    "decorationId": {
      "type": "string",
      "description": "unique id of the decoration"
    },
    "reason": {
      "type": "string",
      "description": "reason for giving the awarding"
    }
  },
  "required": [
    "userId",
    "decorationId",
    "reason"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591ca81c1ee62711cfc19002",
  "confirmed": 1,
  "date": "2017-05-17T19:44:24.926Z",
  "decorationId": "591c81981ee62711cfc18f4a",
  "reason": "war dabei",
  "proposer": "593d5e3f72d35225222bcaba",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "userId": "5918d2ca574b0b1d820a0b24",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the awarding"
    },
    "confirmed": {
      "type": "number",
      "description": "status of the awarding request (0 - in progress, 1 - approved, 2 - rejected)"
    },
    "date": {
      "type": "string",
      "description": "date when the awarding was requested"
    },
    "decorationId": {
      "type": "string",
      "description": "id of decoration that is given with the awarding"
    },
    "reason": {
      "type": "string",
      "description": "reason for giving the awarding"
    },
    "proposer": {
      "type": "string",
      "description": "id of app user who requested this awarding"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "userId": {
      "type": "string",
      "description": "the unique id of the user who got this awarding"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "confirmed",
    "date",
    "decorationId",
    "reason",
    "proposer",
    "timestamp",
    "updatedAt",
    "userId",
    "__v"
  ],
  "additionalProperties": false
}

Decorations

List Decorations
GET/decorations{?q,fractFilter}

List all decorations

Example URI

GET /decorations?q=tapferkeit&fractFilter=BLUFOR
URI Parameters
HideShow
q
string (optional) Example: tapferkeit

Filter string for the partial decoration name

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "591c81981ee62711cfc18f4a",
    "description": "Verliehen an alle Teilnehmer der ArmA3-Kampagne \"Sturm über der Ägäis\" im Jahr 2016",
    "fraction": "GLOBAL",
    "isMedal": false,
    "name": "OPT4 pt.1 - \"Sturm über der Ägäis\"",
    "sortingNumber": 10,
    "timestamp": "2017-05-17T17:00:08.684Z",
    "updatedAt": "2018-01-13T09:57:50.827Z",
    "__v": 2
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the decoration"
      },
      "description": {
        "type": "string",
        "description": "description expressing what the decoration should be given for"
      },
      "fraction": {
        "type": "string",
        "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
      },
      "isMedal": {
        "type": "boolean",
        "description": "show if decoration is medal or ribbon"
      },
      "name": {
        "type": "string",
        "description": "display name of the decoration"
      },
      "sortingNumber": {
        "type": "number",
        "description": "sorting number for lists"
      },
      "timestamp": {
        "type": "string",
        "description": "creation timestamp"
      },
      "updatedAt": {
        "type": "string",
        "description": "version timestamp"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "description",
      "fraction",
      "isMedal",
      "name",
      "sortingNumber",
      "timestamp",
      "updatedAt",
      "__v"
    ]
  }
}

Get Decoration
GET/decorations/{id}

Retrieve single decoration data

Example URI

GET /decorations/5abd3dff6e6a0334d95b8ba0
URI Parameters
HideShow
id
string (required) Example: 5abd3dff6e6a0334d95b8ba0

unique id of the decoration to fetch

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591c81981ee62711cfc18f4a",
  "description": "Verliehen an alle Teilnehmer der ArmA3-Kampagne \"Sturm über der Ägäis\" im Jahr 2016",
  "fraction": "GLOBAL",
  "isMedal": false,
  "name": "OPT4 pt.1 - \"Sturm über der Ägäis\"",
  "sortingNumber": 10,
  "timestamp": "2017-05-17T17:00:08.684Z",
  "updatedAt": "2018-01-13T09:57:50.827Z",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the decoration"
    },
    "description": {
      "type": "string",
      "description": "description expressing what the decoration should be given for"
    },
    "fraction": {
      "type": "string",
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "isMedal": {
      "type": "boolean",
      "description": "show if decoration is medal or ribbon"
    },
    "name": {
      "type": "string",
      "description": "display name of the decoration"
    },
    "sortingNumber": {
      "type": "number",
      "description": "sorting number for lists"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "description",
    "fraction",
    "isMedal",
    "name",
    "sortingNumber",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Create Decoration
POST/decorations

Create a new decoration

Permission: 2

Example URI

POST /decorations
Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain

Super medal 2000
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain

OPFOR
-----BOUNDARY
Content-Disposition: form-data; name="description"
Content-Type: text/plain

For good performance in a battle
-----BOUNDARY
Content-Disposition: form-data; name="isMedal"
Content-Type: text/plain

true
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591c81981ee62711cfc18f4a",
  "description": "Verliehen an alle Teilnehmer der ArmA3-Kampagne \"Sturm über der Ägäis\" im Jahr 2016",
  "fraction": "GLOBAL",
  "isMedal": false,
  "name": "OPT4 pt.1 - \"Sturm über der Ägäis\"",
  "sortingNumber": 10,
  "timestamp": "2017-05-17T17:00:08.684Z",
  "updatedAt": "2018-01-13T09:57:50.827Z",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the decoration"
    },
    "description": {
      "type": "string",
      "description": "description expressing what the decoration should be given for"
    },
    "fraction": {
      "type": "string",
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "isMedal": {
      "type": "boolean",
      "description": "show if decoration is medal or ribbon"
    },
    "name": {
      "type": "string",
      "description": "display name of the decoration"
    },
    "sortingNumber": {
      "type": "number",
      "description": "sorting number for lists"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "description",
    "fraction",
    "isMedal",
    "name",
    "sortingNumber",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Update Decoration
PATCH/decorations/{id}

Update decoration, identified by its id

Permission: 2

Example URI

PATCH /decorations/5abeb420b987672bb1ede643
URI Parameters
HideShow
id
string (required) Example: 5abeb420b987672bb1ede643

unique id of the decoration

Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain

Super medal 2000
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain

OPFOR
-----BOUNDARY
Content-Disposition: form-data; name="description"
Content-Type: text/plain

For good performance in a battle
-----BOUNDARY
Content-Disposition: form-data; name="sortingNumber"
Content-Type: text/plain

2
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591c81981ee62711cfc18f4a",
  "description": "Verliehen an alle Teilnehmer der ArmA3-Kampagne \"Sturm über der Ägäis\" im Jahr 2016",
  "fraction": "GLOBAL",
  "isMedal": false,
  "name": "OPT4 pt.1 - \"Sturm über der Ägäis\"",
  "sortingNumber": 10,
  "timestamp": "2017-05-17T17:00:08.684Z",
  "updatedAt": "2018-01-13T09:57:50.827Z",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the decoration"
    },
    "description": {
      "type": "string",
      "description": "description expressing what the decoration should be given for"
    },
    "fraction": {
      "type": "string",
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "isMedal": {
      "type": "boolean",
      "description": "show if decoration is medal or ribbon"
    },
    "name": {
      "type": "string",
      "description": "display name of the decoration"
    },
    "sortingNumber": {
      "type": "number",
      "description": "sorting number for lists"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "description",
    "fraction",
    "isMedal",
    "name",
    "sortingNumber",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Delete Decoration
DELETE/decorations/{id}

Delete a decoration

Permission: 2

Example URI

DELETE /decorations/5abeb43cb987672bb1ede644
URI Parameters
HideShow
id
string (required) Example: 5abeb43cb987672bb1ede644

unique id of the decoration

Response  204

Promotion

List Promotions
GET/request/promotion{?squadId,inProgress,fractFilter}

List all promotion requests

Example URI

GET /request/promotion?squadId=591470249e9fae286e008e31&inProgress=false&fractFilter=BLUFOR
URI Parameters
HideShow
squadId
string (optional) Example: 591470249e9fae286e008e31

specific squad Id to show the promotion requests for

inProgress
boolean (optional) Default: false Example: false

true to filter by promotion state ‘in progress’

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "proposer": {
      "_id": "5abf5064861d950f157c4a09",
      "username": "hardiready",
      "squad": "591470249e9fae286e308e41"
    },
    "userId": {
      "_id": "5ab68d42f547ed304064e5f7",
      "username": "Jagernaut",
      "rankLvl": 22,
      "squadId": "591470249e9fae286e008e31",
      "updatedAt": "2018-02-24T01:01:25.825Z",
      "__v": 35
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Create Promotion Proposal
POST/request/promotion

Create a new proposal for a promotion, that needs to be approved by higher permission level user to take effect

Permission: 1

Example URI

POST /request/promotion
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "userId": "5ab68d42f547ed304064e5f7",
  "oldRankLvl": 0,
  "newRankLvl": 5
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "description": "id of the army member to promote"
    },
    "oldRankLvl": {
      "type": "number",
      "description": "previous rank level"
    },
    "newRankLvl": {
      "type": "number",
      "description": "new rank level to apply"
    }
  },
  "required": [
    "userId",
    "oldRankLvl",
    "newRankLvl"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5as7d05dcb90ce4da68c4f5f",
  "confirmed": 0,
  "newRankLvl": 14,
  "oldRankLvl": 10,
  "proposer": "5abf5064861d950f157c4a09",
  "timestamp": "2018-03-25T18:54:21.609Z",
  "updatedAt": "2018-03-25T18:54:21.609Z",
  "userId": "5ab68d42f547ed304064e5f7",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the promotion request"
    },
    "confirmed": {
      "type": "number",
      "description": "number representing status of the promotion (0 - in progress, 1 - approved, 2 - rejected)"
    },
    "newRankLvl": {
      "type": "number",
      "description": "new rank level that is requested in this promotion"
    },
    "oldRankLvl": {
      "type": "number",
      "description": "old rank level of the user"
    },
    "proposer": {
      "type": "string",
      "description": "id of app user who requested the promotion"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "userId": {
      "type": "string",
      "description": "id of army member the promotion is requested for"
    },
    "__v": {
      "type": "number",
      "description": "version number of promotion instance"
    }
  },
  "required": [
    "_id",
    "confirmed",
    "newRankLvl",
    "oldRankLvl",
    "proposer",
    "timestamp",
    "updatedAt",
    "userId",
    "__v"
  ],
  "additionalProperties": false
}

Update Promotion Proposal
PATCH/request/promotion/{id}

Update the promotion proposal

Permission: 2

Example URI

PATCH /request/promotion/5abf50d9861d950f157c4a0a
URI Parameters
HideShow
id
string (required) Example: 5abf50d9861d950f157c4a0a

unique id of the promotion

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "5abf50d9861d950f157c4a0a",
  "userId": "5ab68d42f547ed304064e5f7",
  "proposer": "5abf5064861d950f157c4a09",
  "oldRankLvl": 0,
  "newRankLvl": 5,
  "confirmed": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "id of the promotion proposal"
    },
    "userId": {
      "type": "string",
      "description": "id of the army member to promote"
    },
    "proposer": {
      "type": "string",
      "description": "id of the proposing app user"
    },
    "oldRankLvl": {
      "type": "number",
      "description": "previous rank level"
    },
    "newRankLvl": {
      "type": "number",
      "description": "new rank level to apply"
    },
    "confirmed": {
      "type": "number"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5as7d05dcb90ce4da68c4f5f",
  "confirmed": 0,
  "newRankLvl": 14,
  "oldRankLvl": 10,
  "proposer": "5abf5064861d950f157c4a09",
  "timestamp": "2018-03-25T18:54:21.609Z",
  "updatedAt": "2018-03-25T18:54:21.609Z",
  "userId": "5ab68d42f547ed304064e5f7",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the promotion request"
    },
    "confirmed": {
      "type": "number",
      "description": "number representing status of the promotion (0 - in progress, 1 - approved, 2 - rejected)"
    },
    "newRankLvl": {
      "type": "number",
      "description": "new rank level that is requested in this promotion"
    },
    "oldRankLvl": {
      "type": "number",
      "description": "old rank level of the user"
    },
    "proposer": {
      "type": "string",
      "description": "id of app user who requested the promotion"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "userId": {
      "type": "string",
      "description": "id of army member the promotion is requested for"
    },
    "__v": {
      "type": "number",
      "description": "version number of promotion instance"
    }
  },
  "required": [
    "_id",
    "confirmed",
    "newRankLvl",
    "oldRankLvl",
    "proposer",
    "timestamp",
    "updatedAt",
    "userId",
    "__v"
  ],
  "additionalProperties": false
}

Ranks

List Ranks
GET/ranks{?q,fractFilter}

List all ranks

Example URI

GET /ranks?q=Gefr&fractFilter=BLUFOR
URI Parameters
HideShow
q
string (optional) Example: Gefr

filter string which filters for partial rank name

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "591469c9ef4a6810623ed4ea",
    "name": "Gefreiter",
    "fraction": "BLUFOR",
    "level": 1,
    "updatedAt": "2017-09-20T20:25:29.995Z",
    "timestamp": "2017-05-11T13:40:25.051Z",
    "__v": 1
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "the unique id of the rank"
      },
      "name": {
        "type": "string",
        "description": "display name of the rank"
      },
      "fraction": {
        "type": "string",
        "enum": [
          "BLUFOR"
        ],
        "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
      },
      "level": {
        "type": "number",
        "description": "rank level"
      },
      "updatedAt": {
        "type": "string",
        "description": "the version timestamp"
      },
      "timestamp": {
        "type": "string",
        "description": "the creation timestamp"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "name",
      "fraction",
      "level",
      "updatedAt",
      "timestamp",
      "__v"
    ]
  }
}

Get Rank
GET/ranks/{id}

Retrieve single rank data

Example URI

GET /ranks/5aba5504eadcce6332c6a775
URI Parameters
HideShow
id
string (required) Example: 5aba5504eadcce6332c6a775

unique id of the rank to fetch

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591469c9ef4a6810623ed4ea",
  "name": "Gefreiter",
  "fraction": "BLUFOR",
  "level": 1,
  "updatedAt": "2017-09-20T20:25:29.995Z",
  "timestamp": "2017-05-11T13:40:25.051Z",
  "__v": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the rank"
    },
    "name": {
      "type": "string",
      "description": "display name of the rank"
    },
    "fraction": {
      "type": "string",
      "enum": [
        "BLUFOR"
      ],
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "level": {
      "type": "number",
      "description": "rank level"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "the creation timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "name",
    "fraction",
    "level",
    "updatedAt",
    "timestamp",
    "__v"
  ],
  "additionalProperties": false
}

Create Rank
POST/ranks

Create a new rank

Permission: 2

Example URI

POST /ranks
Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----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

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591469c9ef4a6810623ed4ea",
  "name": "Gefreiter",
  "fraction": "BLUFOR",
  "level": 1,
  "updatedAt": "2017-09-20T20:25:29.995Z",
  "timestamp": "2017-05-11T13:40:25.051Z",
  "__v": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the rank"
    },
    "name": {
      "type": "string",
      "description": "display name of the rank"
    },
    "fraction": {
      "type": "string",
      "enum": [
        "BLUFOR"
      ],
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "level": {
      "type": "number",
      "description": "rank level"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "the creation timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "name",
    "fraction",
    "level",
    "updatedAt",
    "timestamp",
    "__v"
  ],
  "additionalProperties": false
}

Update Rank
PATCH/ranks/{id}

Update rank, identified by its id

Permission: 2

Example URI

PATCH /ranks/5abeb23995cf43205225710b
URI Parameters
HideShow
id
string (required) Example: 5abeb23995cf43205225710b

unique id of the rank

Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----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

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591469c9ef4a6810623ed4ea",
  "name": "Gefreiter",
  "fraction": "BLUFOR",
  "level": 1,
  "updatedAt": "2017-09-20T20:25:29.995Z",
  "timestamp": "2017-05-11T13:40:25.051Z",
  "__v": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the rank"
    },
    "name": {
      "type": "string",
      "description": "display name of the rank"
    },
    "fraction": {
      "type": "string",
      "enum": [
        "BLUFOR"
      ],
      "description": "enum expressing the fraction in which the decoration is given\n\n    + Members\n        + `BLUFOR`\n        + `OPFOR`\n        + `GLOBAL`"
    },
    "level": {
      "type": "number",
      "description": "rank level"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "the creation timestamp"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "name",
    "fraction",
    "level",
    "updatedAt",
    "timestamp",
    "__v"
  ],
  "additionalProperties": false
}

Delete Rank
DELETE/ranks/{id}

Delete a rank

Permission: 2

Example URI

DELETE /ranks/5abeb1b995cf43205225710a
URI Parameters
HideShow
id
string (required) Example: 5abeb1b995cf43205225710a

unique id of the rank

Response  204

Squads

List Squads
GET/squads{?q,fractFilter}

Get single army member information

Example URI

GET /squads?q=alpha&fractFilter=BLUFOR
URI Parameters
HideShow
q
string (optional) Example: alpha

filter string which filters for partial squadname

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "591470249e9fae286e008e31",
    "sortingNumber": 30,
    "updatedAt": "2017-05-31T20:43:07.165Z",
    "timestamp": "2017-05-11T14:07:32.471Z",
    "name": "Alpha",
    "fraction": "BLUFOR",
    "__v": 2
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "the unique id of the squad"
      },
      "sortingNumber": {
        "type": "number",
        "description": "the number for orders in lists of squads"
      },
      "updatedAt": {
        "type": "string",
        "description": "version timestamp"
      },
      "timestamp": {
        "type": "string",
        "description": "creation timestamp"
      },
      "name": {
        "type": "string",
        "description": "display name of the squad"
      },
      "fraction": {
        "type": "string",
        "description": "fraction the squad is part of"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "sortingNumber",
      "updatedAt",
      "timestamp",
      "name",
      "fraction",
      "__v"
    ]
  }
}

Get Squad
GET/squads/{id}

Get single squad information

Example URI

GET /squads/5aba54eaeadcce6332c6a774
URI Parameters
HideShow
id
string (required) Example: 5aba54eaeadcce6332c6a774

unique id of the squad

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591470249e9fae286e008e31",
  "sortingNumber": 30,
  "updatedAt": "2017-05-31T20:43:07.165Z",
  "timestamp": "2017-05-11T14:07:32.471Z",
  "name": "Alpha",
  "fraction": "BLUFOR",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the squad"
    },
    "sortingNumber": {
      "type": "number",
      "description": "the number for orders in lists of squads"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "name": {
      "type": "string",
      "description": "display name of the squad"
    },
    "fraction": {
      "type": "string",
      "description": "fraction the squad is part of"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "sortingNumber",
    "updatedAt",
    "timestamp",
    "name",
    "fraction",
    "__v"
  ],
  "additionalProperties": false
}

Create Squad
POST/squads

Create a new squad

Permission: 2

Example URI

POST /squads
Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain

Delta
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain

BLUFOR
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591470249e9fae286e008e31",
  "sortingNumber": 30,
  "updatedAt": "2017-05-31T20:43:07.165Z",
  "timestamp": "2017-05-11T14:07:32.471Z",
  "name": "Alpha",
  "fraction": "BLUFOR",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the squad"
    },
    "sortingNumber": {
      "type": "number",
      "description": "the number for orders in lists of squads"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "name": {
      "type": "string",
      "description": "display name of the squad"
    },
    "fraction": {
      "type": "string",
      "description": "fraction the squad is part of"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "sortingNumber",
    "updatedAt",
    "timestamp",
    "name",
    "fraction",
    "__v"
  ],
  "additionalProperties": false
}

Update Squad
PATCH/squads/{id}

Update squad, identified by its id

Permission: 2

Example URI

PATCH /squads/5abe166f8b7488392a623f12
URI Parameters
HideShow
id
string (required) Example: 5abe166f8b7488392a623f12

unique id of the squad

Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain

test-CSAT
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain

OPFOR
-----BOUNDARY
Content-Disposition: form-data; name="sortingNumber"
Content-Type: text/plain

3
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.png"
Content-Type: image/png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH
AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg==
-----BOUNDARY--
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "591470249e9fae286e008e31",
  "sortingNumber": 30,
  "updatedAt": "2017-05-31T20:43:07.165Z",
  "timestamp": "2017-05-11T14:07:32.471Z",
  "name": "Alpha",
  "fraction": "BLUFOR",
  "__v": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "the unique id of the squad"
    },
    "sortingNumber": {
      "type": "number",
      "description": "the number for orders in lists of squads"
    },
    "updatedAt": {
      "type": "string",
      "description": "version timestamp"
    },
    "timestamp": {
      "type": "string",
      "description": "creation timestamp"
    },
    "name": {
      "type": "string",
      "description": "display name of the squad"
    },
    "fraction": {
      "type": "string",
      "description": "fraction the squad is part of"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "sortingNumber",
    "updatedAt",
    "timestamp",
    "name",
    "fraction",
    "__v"
  ],
  "additionalProperties": false
}

Delete Squad
DELETE/squads/{id}

Delete a squad

Permission: 2

Example URI

DELETE /squads/5abe16f98b7488392a623f17
URI Parameters
HideShow
id
string (required) Example: 5abe16f98b7488392a623f17

unique id of the squad

Response  204

Users

List Users
GET/users{?q,fractFilter,squadId,decorationId,limit,offset}

Get single army member information

Example URI

GET /users?q=hardi&fractFilter=BLUFOR&squadId=5aba54eaeadcce6332c6a774&decorationId=5abd3dff6e6a0334d95b8ba0&limit=20&offset=0
URI Parameters
HideShow
q
string (optional) Example: hardi

filter string which filters for partial username

fractFilter
string (optional) Example: BLUFOR

Field to filter by fraction

Choices: BLUFOR OPFOR GLOBAL

squadId
string (optional) Example: 5aba54eaeadcce6332c6a774

Field to filter by membership of certain squad

decorationId
string (optional) Example: 5abd3dff6e6a0334d95b8ba0

Field to filter by ownership of certain decoration

limit
number (optional) Default: Infinity Example: 20

Maximum number of users to return

offset
number (optional) Default: 0 Example: 0

Offset into result-set (useful for pagination)

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
X-Total-Count: 1
Body
[
  {
    "_id": "5ab68d42f547ed304064e5f7",
    "username": "Jagernaut",
    "rankLvl": 22,
    "squadId": {
      "_id": "591470249e9fae286e008e31",
      "sortingNumber": 30,
      "updatedAt": "2017-05-31T20:43:07.165Z",
      "timestamp": "2017-05-11T14:07:32.471Z",
      "name": "Alpha",
      "fraction": "BLUFOR",
      "__v": 2
    },
    "updatedAt": "2018-02-24T01:01:25.825Z",
    "__v": 35
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the army member"
      },
      "username": {
        "type": "string",
        "description": "the displayed username of the army member"
      },
      "rankLvl": {
        "type": "number",
        "description": "rank level representing the rank"
      },
      "squadId": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "the unique id of the squad"
          },
          "sortingNumber": {
            "type": "number",
            "description": "the number for orders in lists of squads"
          },
          "updatedAt": {
            "type": "string",
            "description": "version timestamp"
          },
          "timestamp": {
            "type": "string",
            "description": "creation timestamp"
          },
          "name": {
            "type": "string",
            "description": "display name of the squad"
          },
          "fraction": {
            "type": "string",
            "description": "fraction the squad is part of"
          },
          "__v": {
            "type": "number",
            "description": "version number"
          }
        },
        "required": [
          "_id",
          "sortingNumber",
          "updatedAt",
          "timestamp",
          "name",
          "fraction",
          "__v"
        ],
        "description": "populated squad which the army member is part of"
      },
      "updatedAt": {
        "type": "string",
        "description": "the version timestamp"
      },
      "__v": {
        "type": "number",
        "description": "the version number of the object"
      }
    },
    "required": [
      "_id",
      "username",
      "rankLvl",
      "squadId",
      "__v"
    ]
  }
}

Get User
GET/users/{id}

Get single army member information

Example URI

GET /users/5ab68d42f547ed304064e5f7
URI Parameters
HideShow
id
string (required) Example: 5ab68d42f547ed304064e5f7

unique id of army-member

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d42f547ed304064e5f7",
  "username": "Jagernaut",
  "rankLvl": 22,
  "squadId": {
    "_id": "591470249e9fae286e008e31",
    "sortingNumber": 30,
    "updatedAt": "2017-05-31T20:43:07.165Z",
    "timestamp": "2017-05-11T14:07:32.471Z",
    "name": "Alpha",
    "fraction": "BLUFOR",
    "__v": 2
  },
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 35
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the army member"
    },
    "username": {
      "type": "string",
      "description": "the displayed username of the army member"
    },
    "rankLvl": {
      "type": "number",
      "description": "rank level representing the rank"
    },
    "squadId": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "the unique id of the squad"
        },
        "sortingNumber": {
          "type": "number",
          "description": "the number for orders in lists of squads"
        },
        "updatedAt": {
          "type": "string",
          "description": "version timestamp"
        },
        "timestamp": {
          "type": "string",
          "description": "creation timestamp"
        },
        "name": {
          "type": "string",
          "description": "display name of the squad"
        },
        "fraction": {
          "type": "string",
          "description": "fraction the squad is part of"
        },
        "__v": {
          "type": "number",
          "description": "version number"
        }
      },
      "required": [
        "_id",
        "sortingNumber",
        "updatedAt",
        "timestamp",
        "name",
        "fraction",
        "__v"
      ],
      "description": "populated squad which the army member is part of"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    }
  },
  "required": [
    "_id",
    "username",
    "rankLvl",
    "squadId",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Create User
POST/users

Create a new army member

Permission: 2

Example URI

POST /users
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "[GNC]Paolo"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "description": "display name of the user"
    }
  },
  "required": [
    "username"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d42f547ed304064e5f7",
  "username": "Jagernaut",
  "rankLvl": 22,
  "squadId": "591470249e9fae286e008e31",
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 35,
  "timestamp": "2018"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the army member"
    },
    "username": {
      "type": "string",
      "description": "the displayed username of the army member"
    },
    "rankLvl": {
      "type": "number",
      "description": "rank level representing the rank"
    },
    "squadId": {
      "type": [
        "string",
        "null"
      ],
      "description": "id of squad which the army member is part of"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    },
    "timestamp": {
      "type": "string",
      "description": "01-20T12:11:23.125Z (string, required) - instance creation timestamp"
    }
  },
  "required": [
    "_id",
    "username",
    "rankLvl",
    "squadId",
    "updatedAt",
    "__v",
    "timestamp"
  ],
  "additionalProperties": false
}

Update User
PUT/users/{id}

Update an army member, identified by its id

Permission: 2

Example URI

PUT /users/5abd4780396bc0487068be0e
URI Parameters
HideShow
id
string (required) Example: 5abd4780396bc0487068be0e

unique id of army-member

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "5abd4780396bc0487068be0e",
  "username": "Paolo",
  "rankLvl": 22,
  "squadId": "591470249e9fae286e008e31"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of army-member"
    },
    "username": {
      "type": "string",
      "description": "display name of the user"
    },
    "rankLvl": {
      "type": "number",
      "description": "rank level representing the rank"
    },
    "squadId": {
      "type": "string",
      "description": "squadId of squad which army member is part of"
    }
  },
  "required": [
    "_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d42f547ed304064e5f7",
  "username": "Jagernaut",
  "rankLvl": 22,
  "squadId": "591470249e9fae286e008e31",
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 35
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the army member"
    },
    "username": {
      "type": "string",
      "description": "the displayed username of the army member"
    },
    "rankLvl": {
      "type": "number",
      "description": "rank level representing the rank"
    },
    "squadId": {
      "type": [
        "string",
        "null"
      ],
      "description": "id of squad which the army member is part of"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    }
  },
  "required": [
    "_id",
    "username",
    "rankLvl",
    "squadId",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Delete User
DELETE/users/{id}

Delete an army member

Permission: 2

Example URI

DELETE /users/5abd4780396bc0487068be0e
URI Parameters
HideShow
id
string (required) Example: 5abd4780396bc0487068be0e

unique id of army-member

Response  204

Statistics

Campaigns

Get Campaigns
GET/campaigns

Get all campaigns information

Example URI

GET /campaigns
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "5abd55ea9e30a76bfef747d6",
    "title": "Ein Kessel Buntes",
    "timestamp": "2017-05-17T19:44:28.751Z",
    "updatedAt": "\"2017-05-17T19:44:28.751Z",
    "__v": 0
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the campaign"
      },
      "title": {
        "type": "string",
        "description": "display title of the campaign"
      },
      "timestamp": {
        "type": "string",
        "description": "creation date"
      },
      "updatedAt": {
        "type": "string",
        "description": "version date"
      },
      "__v": {
        "type": "number",
        "description": "version number"
      }
    },
    "required": [
      "_id",
      "title",
      "timestamp",
      "updatedAt",
      "__v"
    ]
  }
}

Get Campaign
GET/campaigns/{id}

Get single campaign information

Example URI

GET /campaigns/5abd55ea9e30a76bfef747d6
URI Parameters
HideShow
id
string (required) Example: 5abd55ea9e30a76bfef747d6

unique id of campaign

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5abd55ea9e30a76bfef747d6",
  "title": "Ein Kessel Buntes",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the campaign"
    },
    "title": {
      "type": "string",
      "description": "display title of the campaign"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "title",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Get Campaign Containing Specific War
GET/campaigns/with/war/{warId}

Get a single campaign, containing a specific war

Example URI

GET /campaigns/with/war/5abf65ae3fc5fa349ffd5ca3
URI Parameters
HideShow
warId
string (required) Example: 5abf65ae3fc5fa349ffd5ca3

unique id of war that has to be part of campaign

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5abd55ea9e30a76bfef747d6",
  "title": "Ein Kessel Buntes",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the campaign"
    },
    "title": {
      "type": "string",
      "description": "display title of the campaign"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "title",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Create Campaign
POST/campaigns

Create a new campaign

Permission: 3

Example URI

POST /campaigns
Request  Create new army member
HideShow
Headers
Content-Type: application/json
Body
{
  "title": "Return To Kessel In A Schmelz"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "display name of the campaign"
    }
  },
  "required": [
    "title"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5abd55ea9e30a76bfef747d6",
  "title": "Ein Kessel Buntes",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the campaign"
    },
    "title": {
      "type": "string",
      "description": "display title of the campaign"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "title",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Update Campaign
PATCH/campaigns/{id}

Update a campaign, identified by its id

Permission: 3

Example URI

PATCH /campaigns/5abd55ea9e32a76afef777d6
URI Parameters
HideShow
id
string (required) Example: 5abd55ea9e32a76afef777d6

unique id of campaign

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "5abd55ea9e32a76afef777d6",
  "title": "Operation Pandora"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of campaign"
    },
    "title": {
      "type": "string",
      "description": "display name of the campaign"
    }
  },
  "required": [
    "_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5abd55ea9e30a76bfef747d6",
  "title": "Ein Kessel Buntes",
  "timestamp": "2017-05-17T19:44:28.751Z",
  "updatedAt": "\"2017-05-17T19:44:28.751Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the campaign"
    },
    "title": {
      "type": "string",
      "description": "display title of the campaign"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "version date"
    },
    "__v": {
      "type": "number",
      "description": "version number"
    }
  },
  "required": [
    "_id",
    "title",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Delete Campaign
DELETE/campaigns/{id}

Delete a campaign

Permission: 3

Example URI

DELETE /campaigns/5abd58989e30a76bfef747e6
URI Parameters
HideShow
id
string (required) Example: 5abd58989e30a76bfef747e6

unique id of campaign

Response  204

Logs

Get War Logs
GET/logs/{warId}

Ge the combined log object, containing all events in collections, for a single war

Example URI

GET /logs/5abf65ae3fc5fa349ffd5ca3
URI Parameters
HideShow
warId
string (required) Example: 5abf65ae3fc5fa349ffd5ca3

unique id of the war

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "points": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "ptBlufor": 2,
      "ptOpfor": 4,
      "fraction": "OPFOR"
    }
  ],
  "budget": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "oldBudget": 400000,
      "newBudget": 380000,
      "fraction": "BLUFOR"
    }
  ],
  "respawn": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "player": "radical1976"
    }
  ],
  "revive": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "medic": "radical1976",
      "patient": "HardiReady",
      "stabilized": false,
      "fraction": "BLUFOR"
    }
  ],
  "kill": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "shooter": "HardiReady",
      "target": "KalleK",
      "friendlyFire": true,
      "fraction": "BLUFOR",
      "shooterVehicle": "FV-720 Mora",
      "targetVehicle": "Ifrit-GMG",
      "magazine": "30 mm APFSDS"
    }
  ],
  "vehicle": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "shooter": "HardiReady",
      "additionalShooter": [
        "[GNC]Paolo",
        "Dominik"
      ],
      "target": "T-100",
      "fraction": "BLUFOR",
      "vehicleClass": "LIGHT",
      "shooterVehicle": "FV-720 Mora",
      "magazine": "30 mm APFSDS"
    }
  ],
  "transport": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "driver": "radical1976",
      "passenger": "radical1976",
      "distance": 2435,
      "fraction": "BLUFOR"
    }
  ],
  "flag": [
    {
      "_id": "``",
      "war": "``",
      "time": "``",
      "player": "HardiReady",
      "capture": true,
      "flagFraction": "BLUFOR"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "points": {
      "type": "array"
    },
    "budget": {
      "type": "array"
    },
    "respawn": {
      "type": "array"
    },
    "revive": {
      "type": "array"
    },
    "kill": {
      "type": "array"
    },
    "vehicle": {
      "type": "array"
    },
    "transport": {
      "type": "array"
    },
    "flag": {
      "type": "array"
    }
  },
  "required": [
    "points",
    "budget",
    "respawn",
    "revive",
    "kill",
    "vehicle",
    "transport",
    "flag"
  ]
}

Players

Get Player Highscore
GET/players/ranking/{campaignId}

List highscores for player statistics over all wars of a certain campaign. Every highscore player object contains a field sum, representing its order number in the collection

Example URI

GET /players/ranking/5abd55ea9e30a76bfef747d6
URI Parameters
HideShow
campaignId
string (required) Example: 5abd55ea9e30a76bfef747d6

unique id of the campaign

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "kill": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "death": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "friendlyFire": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "vehicleLight": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "vehicleHeavy": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "vehicleAir": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "revive": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "respawn": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ],
  "flagTouch": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "kill": {
      "type": "array",
      "description": "player highscore for kill"
    },
    "death": {
      "type": "array",
      "description": "player highscore for death"
    },
    "friendlyFire": {
      "type": "array",
      "description": "player highscore for friendly fire"
    },
    "vehicleLight": {
      "type": "array",
      "description": "player highscore for light vehicle"
    },
    "vehicleHeavy": {
      "type": "array",
      "description": "player highscore for heavy vehicle"
    },
    "vehicleAir": {
      "type": "array",
      "description": "player highscore for air vehicle"
    },
    "revive": {
      "type": "array",
      "description": "player highscore for revive"
    },
    "respawn": {
      "type": "array",
      "description": "player highscore for respawn"
    },
    "flagTouch": {
      "type": "array",
      "description": "player highscore for flag captures"
    }
  },
  "required": [
    "kill",
    "death",
    "friendlyFire",
    "vehicleLight",
    "vehicleHeavy",
    "vehicleAir",
    "revive",
    "respawn",
    "flagTouch"
  ]
}

Get Player Campaign Statistics
GET/players/single/{campaignId}/{playerSteamId}

Get statistics for a single player for all wars of a campaign he took part at

Example URI

GET /players/single/5abd55ea9e30a76bfef747d6/76561198050321490
URI Parameters
HideShow
campaignId
string (required) Example: 5abd55ea9e30a76bfef747d6

unique id of the campaign

playerSteamId
string (required) Example: 76561198050321490

STEAM application unique user id of player

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "name": "Pumarang",
  "campaign": {
    "_id": "5abd55ea9e30a76bfef747d6",
    "title": "Ein Kessel Buntes",
    "timestamp": "2017-05-17T19:44:28.751Z",
    "updatedAt": "\"2017-05-17T19:44:28.751Z",
    "__v": 0
  },
  "players": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "warId": {
        "_id": "5ab68d41f537ed304064e5f7",
        "title": "Battle No.1",
        "date": "2018-02-24T20:01:25.825Z",
        "endDate": "2018-02-24T22:31:26.855Z",
        "ptBlufor": 11,
        "ptOpfor": 12,
        "playersBlufor": 36,
        "playersOpfor": 34,
        "campaign": "5abd55ea9e30a76bfef747d6",
        "budgetBlufor": 3900000,
        "budgetOpfor": 4100000,
        "endBudgetBlufor": 924000,
        "endBudgetOpfor": 12400,
        "timestamp": "2018-02-24T01:01:25.825Z",
        "updatedAt": "2018-02-24T01:01:25.825Z",
        "__v": 0
      },
      "num": "1"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "latest used playername"
    },
    "campaign": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "unique id of the campaign"
        },
        "title": {
          "type": "string",
          "description": "display title of the campaign"
        },
        "timestamp": {
          "type": "string",
          "description": "creation date"
        },
        "updatedAt": {
          "type": "string",
          "description": "version date"
        },
        "__v": {
          "type": "number",
          "description": "version number"
        }
      },
      "required": [
        "_id",
        "title",
        "timestamp",
        "updatedAt",
        "__v"
      ],
      "description": "campaign reflected from request is"
    },
    "players": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "the displayed username of the army member"
          },
          "fraction": {
            "type": "string",
            "description": "fraction of the player"
          },
          "kill": {
            "type": "number",
            "description": "sum of kills"
          },
          "friendlyFire": {
            "type": "number",
            "description": "sum of friendly fire kills"
          },
          "vehicleLight": {
            "type": "number",
            "description": "sum of light vehicle kills"
          },
          "vehicleHeavy": {
            "type": "number",
            "description": "sum of heavy vehicle kills"
          },
          "vehicleAir": {
            "type": "number",
            "description": "sum of air vehicle kills"
          },
          "death": {
            "type": "number",
            "description": "sum of deaths"
          },
          "respawn": {
            "type": "number",
            "description": "sum of respawns"
          },
          "flagTouch": {
            "type": "number",
            "description": "sum of flag captures"
          },
          "revive": {
            "type": "number",
            "description": "sum of revives"
          },
          "travelDistance": {
            "type": "number",
            "description": "sum of transport meters as passenger"
          },
          "driverDistance": {
            "type": "number",
            "description": "sum of transport meters as pilot/driver"
          },
          "warId": {
            "type": "object",
            "properties": {
              "_id": {
                "type": "string",
                "description": "unique id of the war"
              },
              "title": {
                "type": "string",
                "description": "the display neme of the war"
              },
              "date": {
                "type": "string",
                "description": "war start timestamp"
              },
              "endDate": {
                "type": "string",
                "description": "war end timestamp"
              },
              "ptBlufor": {
                "type": "number",
                "description": "final points fraction Blufor"
              },
              "ptOpfor": {
                "type": "number",
                "description": "final points fraction Opfor"
              },
              "playersBlufor": {
                "type": "number",
                "description": "player count of fraction Blufor"
              },
              "playersOpfor": {
                "type": "number",
                "description": "player count of fraction opfor"
              },
              "campaign": {
                "type": "string",
                "description": "uniquer id of the campaign in which the war was played"
              },
              "budgetBlufor": {
                "type": "number",
                "description": "start budget of fraction Blufor"
              },
              "budgetOpfor": {
                "type": "number",
                "description": "start budget of fraction Opfor"
              },
              "endBudgetBlufor": {
                "type": "number",
                "description": "end budget of fraction Blufor"
              },
              "endBudgetOpfor": {
                "type": "number",
                "description": "end budget of fraction Opfor"
              },
              "timestamp": {
                "type": "string",
                "description": "creation date"
              },
              "updatedAt": {
                "type": "string",
                "description": "the version timestamp"
              },
              "__v": {
                "type": "number",
                "description": "the version number of the object"
              }
            },
            "required": [
              "_id",
              "title",
              "date",
              "endDate",
              "ptBlufor",
              "ptOpfor",
              "playersBlufor",
              "playersOpfor",
              "campaign",
              "budgetBlufor",
              "budgetOpfor",
              "endBudgetBlufor",
              "endBudgetOpfor",
              "timestamp",
              "updatedAt",
              "__v"
            ],
            "description": "war in which this player took part"
          },
          "num": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "fraction",
          "kill",
          "friendlyFire",
          "vehicleLight",
          "vehicleHeavy",
          "vehicleAir",
          "death",
          "respawn",
          "flagTouch",
          "revive",
          "warId"
        ]
      },
      "description": "collection of player instances in the campaign"
    }
  },
  "required": [
    "name",
    "campaign",
    "players"
  ]
}

Wars

List Wars
GET/wars{?campaignId}

List all wars

Example URI

GET /wars?campaignId=5abd55ea9e30a76bfef747d6
URI Parameters
HideShow
campaignId
string (optional) Example: 5abd55ea9e30a76bfef747d6

show only wars from campaign with this id

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "_id": "5ab68d41f537ed304064e5f7",
    "title": "Battle No.1",
    "date": "2018-02-24T20:01:25.825Z",
    "endDate": "2018-02-24T22:31:26.855Z",
    "ptBlufor": 11,
    "ptOpfor": 12,
    "playersBlufor": 36,
    "playersOpfor": 34,
    "campaign": "5abd55ea9e30a76bfef747d6",
    "budgetBlufor": 3900000,
    "budgetOpfor": 4100000,
    "endBudgetBlufor": 924000,
    "endBudgetOpfor": 12400,
    "timestamp": "2018-02-24T01:01:25.825Z",
    "updatedAt": "2018-02-24T01:01:25.825Z",
    "__v": 0
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "_id": {
        "type": "string",
        "description": "unique id of the war"
      },
      "title": {
        "type": "string",
        "description": "the display neme of the war"
      },
      "date": {
        "type": "string",
        "description": "war start timestamp"
      },
      "endDate": {
        "type": "string",
        "description": "war end timestamp"
      },
      "ptBlufor": {
        "type": "number",
        "description": "final points fraction Blufor"
      },
      "ptOpfor": {
        "type": "number",
        "description": "final points fraction Opfor"
      },
      "playersBlufor": {
        "type": "number",
        "description": "player count of fraction Blufor"
      },
      "playersOpfor": {
        "type": "number",
        "description": "player count of fraction opfor"
      },
      "campaign": {
        "type": "string",
        "description": "uniquer id of the campaign in which the war was played"
      },
      "budgetBlufor": {
        "type": "number",
        "description": "start budget of fraction Blufor"
      },
      "budgetOpfor": {
        "type": "number",
        "description": "start budget of fraction Opfor"
      },
      "endBudgetBlufor": {
        "type": "number",
        "description": "end budget of fraction Blufor"
      },
      "endBudgetOpfor": {
        "type": "number",
        "description": "end budget of fraction Opfor"
      },
      "timestamp": {
        "type": "string",
        "description": "creation date"
      },
      "updatedAt": {
        "type": "string",
        "description": "the version timestamp"
      },
      "__v": {
        "type": "number",
        "description": "the version number of the object"
      }
    },
    "required": [
      "_id",
      "title",
      "date",
      "endDate",
      "ptBlufor",
      "ptOpfor",
      "playersBlufor",
      "playersOpfor",
      "campaign",
      "budgetBlufor",
      "budgetOpfor",
      "endBudgetBlufor",
      "endBudgetOpfor",
      "timestamp",
      "updatedAt",
      "__v"
    ]
  }
}

Get War
GET/wars/{id}

Retrieve single war data

Example URI

GET /wars/5abf65ae3fc5fa349ffd5ca3
URI Parameters
HideShow
id
string (required) Example: 5abf65ae3fc5fa349ffd5ca3

unique id of the war to fetch

Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d41f537ed304064e5f7",
  "title": "Battle No.1",
  "date": "2018-02-24T20:01:25.825Z",
  "endDate": "2018-02-24T22:31:26.855Z",
  "ptBlufor": 11,
  "ptOpfor": 12,
  "playersBlufor": 36,
  "playersOpfor": 34,
  "campaign": "5abd55ea9e30a76bfef747d6",
  "budgetBlufor": 3900000,
  "budgetOpfor": 4100000,
  "endBudgetBlufor": 924000,
  "endBudgetOpfor": 12400,
  "timestamp": "2018-02-24T01:01:25.825Z",
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 0,
  "players": [
    {
      "name": "Jagernaut",
      "fraction": "OPFOR",
      "kill": 5,
      "friendlyFire": 0,
      "vehicleLight": 1,
      "vehicleHeavy": 1,
      "vehicleAir": 0,
      "death": 3,
      "respawn": 2,
      "flagTouch": 1,
      "revive": 0,
      "travelDistance": 16535,
      "driverDistance": 1250,
      "_id": "5ab68d42f547ed304064e5f7",
      "warId": "5abf65ae3fc5fa349ffd5ca3",
      "steamUUID": 76561192214911200,
      "performance": "5abf65ae3fc5fa349ffd5cs2",
      "timestamp": "2018-02-24T01:01:25.825Z",
      "updatedAt": "2018-02-24T01:01:25.825Z",
      "__v": 0
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the war"
    },
    "title": {
      "type": "string",
      "description": "the display neme of the war"
    },
    "date": {
      "type": "string",
      "description": "war start timestamp"
    },
    "endDate": {
      "type": "string",
      "description": "war end timestamp"
    },
    "ptBlufor": {
      "type": "number",
      "description": "final points fraction Blufor"
    },
    "ptOpfor": {
      "type": "number",
      "description": "final points fraction Opfor"
    },
    "playersBlufor": {
      "type": "number",
      "description": "player count of fraction Blufor"
    },
    "playersOpfor": {
      "type": "number",
      "description": "player count of fraction opfor"
    },
    "campaign": {
      "type": "string",
      "description": "uniquer id of the campaign in which the war was played"
    },
    "budgetBlufor": {
      "type": "number",
      "description": "start budget of fraction Blufor"
    },
    "budgetOpfor": {
      "type": "number",
      "description": "start budget of fraction Opfor"
    },
    "endBudgetBlufor": {
      "type": "number",
      "description": "end budget of fraction Blufor"
    },
    "endBudgetOpfor": {
      "type": "number",
      "description": "end budget of fraction Opfor"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    },
    "players": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "the displayed username of the army member"
          },
          "fraction": {
            "type": "string",
            "description": "fraction of the player"
          },
          "kill": {
            "type": "number",
            "description": "sum of kills"
          },
          "friendlyFire": {
            "type": "number",
            "description": "sum of friendly fire kills"
          },
          "vehicleLight": {
            "type": "number",
            "description": "sum of light vehicle kills"
          },
          "vehicleHeavy": {
            "type": "number",
            "description": "sum of heavy vehicle kills"
          },
          "vehicleAir": {
            "type": "number",
            "description": "sum of air vehicle kills"
          },
          "death": {
            "type": "number",
            "description": "sum of deaths"
          },
          "respawn": {
            "type": "number",
            "description": "sum of respawns"
          },
          "flagTouch": {
            "type": "number",
            "description": "sum of flag captures"
          },
          "revive": {
            "type": "number",
            "description": "sum of revives"
          },
          "travelDistance": {
            "type": "number",
            "description": "sum of transport meters as passenger"
          },
          "driverDistance": {
            "type": "number",
            "description": "sum of transport meters as pilot/driver"
          },
          "_id": {
            "type": "string",
            "description": "unique id of the army member"
          },
          "warId": {
            "type": "string",
            "description": "war in which this player took part"
          },
          "steamUUID": {
            "type": "number",
            "description": "unique ID for STEAM platform account"
          },
          "performance": {
            "type": "string",
            "description": "id of corresponding performance log entry"
          },
          "timestamp": {
            "type": "string",
            "description": "the entity creation timestamp"
          },
          "updatedAt": {
            "type": "string",
            "description": "the version timestamp"
          },
          "__v": {
            "type": "number",
            "description": "the version number of the object"
          }
        },
        "required": [
          "name",
          "fraction",
          "kill",
          "friendlyFire",
          "vehicleLight",
          "vehicleHeavy",
          "vehicleAir",
          "death",
          "respawn",
          "flagTouch",
          "revive",
          "_id",
          "warId",
          "__v"
        ]
      },
      "description": "collection of all participating players with their statistics"
    }
  },
  "required": [
    "_id",
    "title",
    "date",
    "endDate",
    "ptBlufor",
    "ptOpfor",
    "playersBlufor",
    "playersOpfor",
    "campaign",
    "budgetBlufor",
    "budgetOpfor",
    "endBudgetBlufor",
    "endBudgetOpfor",
    "timestamp",
    "updatedAt",
    "__v",
    "players"
  ],
  "additionalProperties": false
}

Create War
POST/wars

Create a new war

Permission: 3

NOTE: First line of the log file sent should be NOT beginning of actual game logs! This might result in unparsable line.

Example URI

POST /wars
Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
Body
-----BOUNDARY
Content-Disposition: form-data; name="title"
Content-Type: text/plain

Battle XY
-----BOUNDARY
Content-Disposition: form-data; name="campaign"
Content-Type: text/plain

5abd55ea9e30a76bfef747d6
-----BOUNDARY
Content-Disposition: form-data; name="log"; filename="war_2018_log.rpt"
Content-Type: text/plain

\
2018/03/20, 20:05:43 "[OPT] (Budget) LOG: 0:00:00 --- Startbudget: NATO 4.5355e+006 - CSAT 4.22125e+006"
2018/03/20, 20:06:45 "[OPT] (Budget) LOG: 0:01:02 --- NATO alt: 4.5355e+006 - neu: 4.1955e+006 - Differenz: -340000"
2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Saxe (WEST) von: Selbstverschulden."
2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Pumarang (WEST) von: Saxe (WEST)."
2018/03/20, 20:10:13 "[OPT] (Budget) LOG: 0:04:30 --- CSAT alt: 2.38425e+006 - neu: 2.32425e+006 - Differenz: -60000"
2018/03/20, 20:10:38 "[OPT] (Respawn) LOG: 0:04:55 --- Spieler: Pumarang - Kosten: 3000"
2018/03/20, 20:15:54 "[OPT] (Punkte) LOG: 0:10:11 --- Kein Dominator (NATO 0 | CSAT 0)"
2018/03/20, 20:17:51 "[OPT] (Abschuss) LOG: 0:12:08 --- patze (EAST) von: Wiesl (WEST)."
2018/03/20, 20:18:20 "[OPT] (Fahne) LOG: 0:12:37 --- CSAT Flagge erobert von Wiesl"
2018/03/20, 20:18:38 "[OPT] (Abschuss) LOG: 0:12:55 --- Nicolas (WEST) von: Wiesl (WEST)."
2018/03/20, 20:18:59 "[OPT] (Punkte) LOG: 0:13:16 --- NATO +1 (NATO 1 | CSAT 0)"
2018/03/20, 20:19:38 "[OPT] (Fahne) LOG: 0:13:56 --- CSAT Flagge gesichert von ALASTOR"
2018/03/20, 20:22:18 "[OPT] (Abschuss) LOG: 0:16:35 --- Fahrzeug: Hunter-HMG (OPT_NATO) von: Murda]X[ (EAST)."
2018/03/20, 20:37:19 "[OPT] (Transport) LOG: 0:31:36 --- Dominik (WEST) wurde von Ponykloete (WEST) eingeflogen (8666.94 m)"
2018/03/20, 20:41:27 "[OPT] (Revive) LOG: 0:35:44 --- Bodochecker (EAST) wurde von ALASTOR (EAST) stabilisiert."
2018/03/20, 20:41:35 "[OPT] (Revive) LOG: 0:35:52 --- Andi-de (WEST) wurde von Wiesl (WEST) wiederbelebt."
2018/03/20, 22:35:43 "[OPT] (Mission) LOG: 2:30:00 --- Missionzeit abgelaufen"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Pumarang (WEST), PUID 76561198050321485"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Mercurat (WEST), PUID 76561198278842491"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- KalleK (EAST), PUID 76561197977676036"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- MAPster (EAST), PUID 76561198009882133"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- LyrikEmu (WEST), PUID 76561198218910400"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Philipp (EAST), PUID 76561198041792069"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Wiesl (WEST), PUID 76561198059648090"
2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Murda]X[ (EAST), PUID 76561197971121630"
2018/03/20, 22:35:43 "[OPT] (Budget) LOG: 2:30:00 --- Endbudget: (NATO 1997000 | CSAT 512000)"
2018/03/20, 22:35:43 "[OPT] (Punkte) LOG: 2:30:00 --- Endpunktestand: (NATO 34 | CSAT 25)"
-----BOUNDARY--
Response  201
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d41f537ed304064e5f7",
  "title": "Battle No.1",
  "date": "2018-02-24T20:01:25.825Z",
  "endDate": "2018-02-24T22:31:26.855Z",
  "ptBlufor": 11,
  "ptOpfor": 12,
  "playersBlufor": 36,
  "playersOpfor": 34,
  "campaign": "5abd55ea9e30a76bfef747d6",
  "budgetBlufor": 3900000,
  "budgetOpfor": 4100000,
  "endBudgetBlufor": 924000,
  "endBudgetOpfor": 12400,
  "timestamp": "2018-02-24T01:01:25.825Z",
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the war"
    },
    "title": {
      "type": "string",
      "description": "the display neme of the war"
    },
    "date": {
      "type": "string",
      "description": "war start timestamp"
    },
    "endDate": {
      "type": "string",
      "description": "war end timestamp"
    },
    "ptBlufor": {
      "type": "number",
      "description": "final points fraction Blufor"
    },
    "ptOpfor": {
      "type": "number",
      "description": "final points fraction Opfor"
    },
    "playersBlufor": {
      "type": "number",
      "description": "player count of fraction Blufor"
    },
    "playersOpfor": {
      "type": "number",
      "description": "player count of fraction opfor"
    },
    "campaign": {
      "type": "string",
      "description": "uniquer id of the campaign in which the war was played"
    },
    "budgetBlufor": {
      "type": "number",
      "description": "start budget of fraction Blufor"
    },
    "budgetOpfor": {
      "type": "number",
      "description": "start budget of fraction Opfor"
    },
    "endBudgetBlufor": {
      "type": "number",
      "description": "end budget of fraction Blufor"
    },
    "endBudgetOpfor": {
      "type": "number",
      "description": "end budget of fraction Opfor"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    }
  },
  "required": [
    "_id",
    "title",
    "date",
    "endDate",
    "ptBlufor",
    "ptOpfor",
    "playersBlufor",
    "playersOpfor",
    "campaign",
    "budgetBlufor",
    "budgetOpfor",
    "endBudgetBlufor",
    "endBudgetOpfor",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Update War
PATCH/wars/{id}

Update a war, identified by its id

Permission: 3

Example URI

PATCH /wars/5abf65ae2df5fa349ffd5ca3
URI Parameters
HideShow
id
string (required) Example: 5abf65ae2df5fa349ffd5ca3

unique id of campaign

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "5abf65ae2df5fa349ffd5ca3",
  "title": "Final Touchdown",
  "date": "2017-05-11T20:00:00.471Z",
  "endDate": "2017-05-12T00:30:32.471Z",
  "ptBlufor": 5,
  "ptOpfor": 5,
  "playersBlufor": 20,
  "playersOpfor": 20,
  "budgetBlufor": 3000000,
  "budgetOpfor": 3000000,
  "endBudgetBlufor": 10000,
  "endBudgetOpfor": 12000
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of war"
    },
    "title": {
      "type": "string",
      "description": "display name of the war"
    },
    "date": {
      "type": "string",
      "description": "starting date"
    },
    "endDate": {
      "type": "string",
      "description": "end date"
    },
    "ptBlufor": {
      "type": "number",
      "description": "points Blufor"
    },
    "ptOpfor": {
      "type": "number",
      "description": "points Opfor"
    },
    "playersBlufor": {
      "type": "number",
      "description": "number of players Blufor"
    },
    "playersOpfor": {
      "type": "number",
      "description": "number of players Opfor"
    },
    "budgetBlufor": {
      "type": "number",
      "description": "start budget Blufor"
    },
    "budgetOpfor": {
      "type": "number",
      "description": "start budget Opfor"
    },
    "endBudgetBlufor": {
      "type": "number",
      "description": "end budget Blufor"
    },
    "endBudgetOpfor": {
      "type": "number",
      "description": "end budget Opfor"
    }
  },
  "required": [
    "_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json; charset=utf-8
Body
{
  "_id": "5ab68d41f537ed304064e5f7",
  "title": "Battle No.1",
  "date": "2018-02-24T20:01:25.825Z",
  "endDate": "2018-02-24T22:31:26.855Z",
  "ptBlufor": 11,
  "ptOpfor": 12,
  "playersBlufor": 36,
  "playersOpfor": 34,
  "campaign": "5abd55ea9e30a76bfef747d6",
  "budgetBlufor": 3900000,
  "budgetOpfor": 4100000,
  "endBudgetBlufor": 924000,
  "endBudgetOpfor": 12400,
  "timestamp": "2018-02-24T01:01:25.825Z",
  "updatedAt": "2018-02-24T01:01:25.825Z",
  "__v": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "unique id of the war"
    },
    "title": {
      "type": "string",
      "description": "the display neme of the war"
    },
    "date": {
      "type": "string",
      "description": "war start timestamp"
    },
    "endDate": {
      "type": "string",
      "description": "war end timestamp"
    },
    "ptBlufor": {
      "type": "number",
      "description": "final points fraction Blufor"
    },
    "ptOpfor": {
      "type": "number",
      "description": "final points fraction Opfor"
    },
    "playersBlufor": {
      "type": "number",
      "description": "player count of fraction Blufor"
    },
    "playersOpfor": {
      "type": "number",
      "description": "player count of fraction opfor"
    },
    "campaign": {
      "type": "string",
      "description": "uniquer id of the campaign in which the war was played"
    },
    "budgetBlufor": {
      "type": "number",
      "description": "start budget of fraction Blufor"
    },
    "budgetOpfor": {
      "type": "number",
      "description": "start budget of fraction Opfor"
    },
    "endBudgetBlufor": {
      "type": "number",
      "description": "end budget of fraction Blufor"
    },
    "endBudgetOpfor": {
      "type": "number",
      "description": "end budget of fraction Opfor"
    },
    "timestamp": {
      "type": "string",
      "description": "creation date"
    },
    "updatedAt": {
      "type": "string",
      "description": "the version timestamp"
    },
    "__v": {
      "type": "number",
      "description": "the version number of the object"
    }
  },
  "required": [
    "_id",
    "title",
    "date",
    "endDate",
    "ptBlufor",
    "ptOpfor",
    "playersBlufor",
    "playersOpfor",
    "campaign",
    "budgetBlufor",
    "budgetOpfor",
    "endBudgetBlufor",
    "endBudgetOpfor",
    "timestamp",
    "updatedAt",
    "__v"
  ],
  "additionalProperties": false
}

Delete War
DELETE/wars/{id}

Delete a war

Permission: 3

Example URI

DELETE /wars/5abf65d83fc5fa349ffd5cbb
URI Parameters
HideShow
id
string (required) Example: 5abf65d83fc5fa349ffd5cbb

unique id of the war

Response  204

Generated by aglio on 03 Mar 2019