### /aboplan-rest-api/amialive/ GET

Returns "i am alive" when service is runnning

### /aboplan-rest-api/serviceversion/ GET

Returns file version of app

### /aboplan-rest-api/favicon.ico/ GET

Returns 404 not found

### /aboplan-rest-api/robots.txt/ GET

Returns a robots.txt to disallow ai bots

### /aboplan-rest-api/*/ OPTIONS

Returns poosible http verbs for accessed route

### /aboplan-rest-api// GET

Shows a website with descriptions of all endpoints

### /aboplan-rest-api/doku/ GET

Shows a website with descriptions of all endpoints

### /aboplan-rest-api/exception/ 

Creates an exception (for testing)

### /aboplan-rest-api/wadl/ GET

Shows a generated WADL file

### /aboplan-rest-api/markdown/ GET

Generates a Markdown file

### /aboplan-rest-api/v1/school/ GET

returns all valid schools

#### Response Body

{
          "list" : [
            {
              "id" : "integer: internal id",
              "name" : "string(60): mame of the school"
            }
          ]
        }

### /aboplan-rest-api/v1/school/:sch_id/application/ GET

List all application orders for the shool, that the user corresponds to

#### Route Parameter

##### sch_id: Integer

internal ID fo school

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

#### Response Body

{
          "applications" : [
            {
              "id" : "integer: internal application id",
              "name" : "string(60): name of the  contract partner",
              "surname" : "string(60): surname",
              "address" : "string(60): street and house number",
              "city" : "string(60): city",
              "postalcode" : "string(10): postalcode of the address",
              "birthdate" : "date: birthdate (ISO8601)",
              "schoolDuration" : "date: first day of the month after the school visit ends",
              "state" : "string: ACCEPTED, REJECTED, OPEN",
              "rejectionReason" : "string: reasoning of the rejection"
            }
          ]
        }

### /aboplan-rest-api/v1/school/application/ GET

lists all schools with undecided applications

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

#### Response Body

[
          {
            "sch_id" : "integer: internal school id",
            "name" : "string: name of the school",
            "count" : "integer: count of open applications"
          }
        ]

### /aboplan-rest-api/v1/school/application/:id/ POST

sets the appication status in the role of a school

#### Route Parameter

##### id: Integer

internal application id

#### Request Body

{
          "schoolDuration" : "date: first day of the month after the school visit ends",
          "state" : "string: ACCEPTED, REJECTED",
          "rejectionReason" : "string: reasoning of the rejection, empty if Accepted"
        }

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

### /aboplan-rest-api/v1/schoolboard/application/ GET

List all open appication orders for the school board, that the user corresponds to

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

#### Response Body

{
          "applications" : [
            {
              "id" : "integer: internal application id",
              "name" : "string(60): name of the  contract partner",
              "surname" : "string(60): surname",
              "address" : "string(60): street and house number",
              "city" : "string(60): city",
              "postalcode" : "string(10): postalcode of the address",
              "birthdate" : "date: birthdate (ISO8601)",
              "siblings" : [
                {
                  "name" : "string(60): name of the sibling",
                  "surname" : "string(60): surname of the sibling",
                  "sch_id" : "integer: internal id for school",
                  "school" : "string(60): name of the school",
                  "birthdate" : "date: birthdate of the sibling (ISO8601)",
                  "abonr" : "string(30): abonnement number of the sibling"
                }
              ],
              "schoolDuration" : "date: first day of the month after the school visit ends",
              "school" : "string: name of the school"
            }
          ]
        }

### /aboplan-rest-api/v1/application/application/:id/ POST

sets the appication status in the role of school board

#### Route Parameter

##### id: Integer

internal application id

#### Request Body

{
          "state" : "string: ACCEPTED, REJECTED",
          "decision" : "string: decision of the school board",
          "comment" : "string: reasoning in case of a rejection"
        }

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

### /aboplan-rest-api/v1/article/ GET

returns all valid articles

#### Response Body

{
          "list" : [
            {
              "id" : "integer: internal id",
              "name" : "string(60): name of the article"
            }
          ]
        }

### /aboplan-rest-api/v1/article/:articleid/ GET

returns details for article

#### Route Parameter

##### articleid: Integer

id of the article

#### Response Body

{
          "id" : "integer: internal id",
          "name" : "string(60): name of the article",
          "fields" : [
            {
              "fieldname" : "string: Name of the Field",
              "mandatory" : "Boolean: True if the Field has to be filled out",
              "visible" : "Boolean: True if the Field is visible"
            }
          ]
        }

### /aboplan-rest-api/v1/article/:articleid/price/ GET

Returns price of an article

#### Route Parameter

##### articleid: Integer

id of the article

#### Query Parameter

##### date: Date

date on which the price should be valid. Today if not provided (ISO8601)

#### Response Body

{
          "price" : "Double: price of the article in euro"
        }

### /aboplan-rest-api/v1/application/order/ POST

Post an application for an abonnement to the system

#### Request Body

{
          "articleid" : "integer: Internal ID for the requested tickettype",
          "abobegin" : "date: starting date for the abonnement",
          "owner" : {
            "name" : "string(60): name of the ticket owner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "gender" : "char: gender of the person (m,w,d)",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number",
            "bank" : "string(100): name of the bank",
            "iban" : "string(22): iban"
          },
          "contractpartner" : {
            "name" : "string(60): name of the  contract partner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "gender" : "char: gender of the person (m,w,d)",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number",
            "bank" : "string(100): name of the bank",
            "iban" : "string(22): iban"
          },
          "dataprotection" : "boolean: True, if the dataprotection agreement was accepted",
          "advertisement" : "boolean: True, if the 'Datenschutzeigenwerbung' was accepted",
          "research" : "boolean: True, if the 'Markt- und Meinungsforschung' was accepted",
          "tns" : "boolean: True if the Terms and Services are accepted",
          "bikevrr" : "boolean: True if additional article 'Fahhrad VRR' shall be added",
          "bikenrw" : "boolean: True if additional article 'Fahhrad NRW' shall be added",
          "firstclassvrr" : "boolean: True if additional article '1. Klasse VRR' shall be added",
          "firstclassnrw" : "boolean: True if additional article '1. Klasse NRW' shall be added",
          "school" : {
            "sch_id" : "integer: internal id for school",
            "name" : "string(60): name of the school",
            "schoolduration" : "date: first day of the month after the school visit ends"
          },
          "siblings" : [
            {
              "name" : "string(60): name of the sibling",
              "surname" : "string(60): surname of the sibling",
              "sch_id" : "integer: internal id for school",
              "school" : "string(60): name of the school",
              "birthdate" : "date: birthdate of the sibling (ISO8601)",
              "abonr" : "string(30): abonnement number of the sibling"
            }
          ],
          "socialcert" : "boolean: True if a Social Certification is attached to the application",
          "company" : {
            "name" : "string(60): name of the company",
            "contract" : "boolean: True if the contract of the company is attached to the application"
          }
        }

#### Response Body

{
          "applicationid" : "integer: ID of the Created Application."
        }

### /aboplan-rest-api/v1/application/order/:applicationid/file/ PUT

Attaches a file to an application

### /aboplan-rest-api/v1/application/cancel/ POST

Post an application for an abonnement cancellation to the system

#### Request Body

{
          "abonr" : "string(30): abonnement number",
          "aboend" : "date: ending date for the abonnement (ISO8601)",
          "owner" : {
            "name" : "string(60): name of the ticket owner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number"
          },
          "contractpartner" : {
            "name" : "string(60): name of the  contract partner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number"
          }
        }

### /aboplan-rest-api/v1/application/change/ POST

Post an application for an abonnement change to the system

#### Request Body

{
          "abonr" : "string(30): abonnement number",
          "validfrom" : "date: changes are valid from this date (ISO8601)",
          "owner" : {
            "name" : "string(60): name of the ticket owner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number",
            "bank" : "string(100): name of the bank",
            "iban" : "string(22): iban"
          },
          "contractpartner" : {
            "name" : "string(60): name of the  contract partner",
            "surname" : "string(60): surname",
            "address" : "string(60): street and house number",
            "city" : "string(60): city",
            "postalcode" : "string(10): postalcode of the address",
            "birthdate" : "date: birthdate (ISO8601)",
            "mail" : "string(60): email address",
            "phone" : "string(60): phone number",
            "bank" : "string(100): name of the bank",
            "iban" : "string(22): iban"
          },
          "dataprotection" : "boolean: True, if the dataprotection agreement was accepted",
          "advertisement" : "boolean: True, if the 'Datenschutzeigenwerbung' was accepted",
          "research" : "boolean: True, if the 'Markt- und Meinungsforschung' was accepted"
        }

### /aboplan-rest-api/v1/checkiban/ POST

Check if the attached IBAN is valid

#### Request Body

{
          "iban" : "string(22): iban"
        }

#### Response Body

{
          "result" : "boolean: true, if the IBAN is valid"
        }

### /aboplan-rest-api/v1/accesstokens/ POST

Checks login credentials and returns session token if credentials are valid.

#### Request Body

{
          "username" : "string*: name of the user",
          "password" : "string*: password SHA1 hash base64 coded"
        }

#### Response Body

{
          "token" : "string(38): session token for the user",
          "validUntil" : "datetime: datetime until the token is valid",
          "role" : "string: role valid for the user.",
          "schools" : "integer[]: schools valid for the user.",
          "changePW" : "boolean: if True, the password should be changed after login"
        }

### /aboplan-rest-api/v1/accesstokens/ DELETE

Invalidates the provided session token

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

### /aboplan-rest-api/v1/accesstokens/change/ POST

Changes login credentials for the provided user

#### Request Body

{
          "password" : "string*: new password SHA1 hash base64 coded"
        }

#### Request Header

##### Authorization

Session Token

Value: Bearer {Token}

### /aboplan-rest-api/v1/accesstokens/reset/ POST

Reset login credentials for the provided user and sends a recovery mail

#### Request Body

{
          "username" : "string*: name of the user"
        }

