<?xml version="1.0"?>
<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wadl.dev.java.net/2009/02 wadl.xsd">
<resources base="http://aboplan-l2.svgd.de/aboplan-rest-api/">
<resource path="amialive/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerCheckAlive">Returns "i am alive" when service is runnning</doc>
</method>
</resource>
<resource path="serviceversion/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerServiceVersion">Returns file version of app</doc>
</method>
</resource>
<resource path="favicon.ico/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorker404">Returns 404 not found</doc>
</method>
</resource>
<resource path="robots.txt/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerServiceRobots">Returns a robots.txt to disallow ai bots</doc>
</method>
</resource>
<resource path="*/">
<method name="OPTIONS">
<doc xml:lang="en" title="TFpRestWorkerOptions">Returns poosible http verbs for accessed route</doc>
</method>
</resource>
<resource path="/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerDokuHtml">Shows a website with descriptions of all endpoints</doc>
</method>
</resource>
<resource path="doku/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerDokuHtml">Shows a website with descriptions of all endpoints</doc>
</method>
</resource>
<resource path="exception/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerTestExceptionJson">Creates an exception (for testing)</doc>
</method>
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerTestExceptionJson">Creates an exception (for testing)</doc>
</method>
<method name="PUT">
<doc xml:lang="en" title="TFpRestWorkerTestExceptionJson">Creates an exception (for testing)</doc>
</method>
<method name="DELETE">
<doc xml:lang="en" title="TFpRestWorkerTestExceptionJson">Creates an exception (for testing)</doc>
</method>
</resource>
<resource path="wadl/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerWadl">Shows a generated WADL file</doc>
</method>
</resource>
<resource path="markdown/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerMarkdown">Generates a Markdown file</doc>
</method>
</resource>
<resource path="v1/school/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerSchoolList">returns all valid schools</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"list":[{"id":"integer: internal id","name":"string(60): mame of the school"}]}</doc>
</response>
</method>
</resource>
<resource path="v1/school/:sch_id/application/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerApplicationListSchool">List all application orders for the shool, that the user corresponds to</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}]}</doc>
</response>
</method>
</resource>
<resource path="v1/school/application/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerApplicationSchoolOverview">lists all schools with undecided applications</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">[{"sch_id":"integer: internal school id","name":"string: name of the school","count":"integer: count of open applications"}]</doc>
</response>
</method>
</resource>
<resource path="v1/school/application/:id/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerApplicationAcknowledgelSchool">sets the appication status in the role of a school</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}</doc>
<param name="Authorization" style="header" type="xsd:anyURI" default="Bearer {Token}"/> 
</request>
</method>
</resource>
<resource path="v1/schoolboard/application/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerApplicationListSchoolBoard">List all open appication orders for the school board, that the user corresponds to</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}]}</doc>
</response>
</method>
</resource>
<resource path="v1/application/application/:id/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerApplicationAcknowledgeSchoolBoard">sets the appication status in the role of school board</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"state":"string: ACCEPTED, REJECTED","decision":"string: decision of the school board","comment":"string: reasoning in case of a rejection"}</doc>
<param name="Authorization" style="header" type="xsd:anyURI" default="Bearer {Token}"/> 
</request>
</method>
</resource>
<resource path="v1/article/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerArticleList">returns all valid articles</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"list":[{"id":"integer: internal id","name":"string(60): name of the article"}]}</doc>
</response>
</method>
</resource>
<resource path="v1/article/:articleid/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerArticleDetail">returns details for article</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}]}</doc>
</response>
</method>
</resource>
<resource path="v1/article/:articleid/price/">
<method name="GET">
<doc xml:lang="en" title="TFpRestWorkerArticlePrice">Returns price of an article</doc>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"price":"Double: price of the article in euro"}</doc>
</response>
</method>
</resource>
<resource path="v1/application/order/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerApplicationOrder">Post an application for an abonnement to the system</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}}</doc>
</request>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"applicationid":"integer: ID of the Created Application."}</doc>
</response>
</method>
</resource>
<resource path="v1/application/order/:applicationid/file/">
<method name="PUT">
<doc xml:lang="en" title="TFpRestWorkerApplicationOrderFile">Attaches a file to an application</doc>
</method>
</resource>
<resource path="v1/application/cancel/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerApplicationCancel">Post an application for an abonnement cancellation to the system</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}}</doc>
</request>
</method>
</resource>
<resource path="v1/application/change/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerApplicationChange">Post an application for an abonnement change to the system</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}</doc>
</request>
</method>
</resource>
<resource path="v1/checkiban/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerCheckIBAN">Check if the attached IBAN is valid</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"iban":"string(22): iban"}</doc>
</request>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"result":"boolean: true, if the IBAN is valid"}</doc>
</response>
</method>
</resource>
<resource path="v1/accesstokens/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerTokenLogin">Checks login credentials and returns session token if credentials are valid.</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"username":"string*: name of the user","password":"string*: password SHA1 hash base64 coded"}</doc>
</request>
<response>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"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"}</doc>
</response>
</method>
</resource>
<resource path="v1/accesstokens/">
<method name="DELETE">
<doc xml:lang="en" title="TFpRestWorkerTokenInvalidate">Invalidates the provided session token</doc>
</method>
</resource>
<resource path="v1/accesstokens/change/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerTokenChange">Changes login credentials for the provided user</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"password":"string*: new password SHA1 hash base64 coded"}</doc>
<param name="Authorization" style="header" type="xsd:anyURI" default="Bearer {Token}"/> 
</request>
</method>
</resource>
<resource path="v1/accesstokens/reset/">
<method name="POST">
<doc xml:lang="en" title="TFpRestWorkerTokenReset">Reset login credentials for the provided user and sends a recovery mail</doc>
<request>
<representation mediaType="app/json"/>
<doc xml:lang="en" title="JsonBody">{"username":"string*: name of the user"}</doc>
</request>
</method>
</resource>
</resources>
</application>
