The api is protected by an MVC .NET implementation of OAuth 2.0. In order to use the api users must have an account which can be obtained at Viasuisse.
To use the api the user must first obtain a token by calling /v1/Token with a POST-Request. The body of the request must contain the login information of the user:
username={username}&password={password}&grant_type=password
The response of the call will look like this:
{ "access_token": "HEcectNlLj6OOvwlIbivgiqq-P6wmFW8W_8Y3s3uexbWQT5woBIBqXhBfuHeKw9CooMSnPcTwPAeY-3lie4UJ0SsETit3zzeyrHIip3kZu9Os--ppsM8k7P58AosN6jMlx2ybtbzTZefqfXZpBfW6gDsXPpP97RtfomOH2Jdd-4bTJufoTuwsnmFGWoYS6TaDHKvF4Z-g_c-qnLYc2g6dbYc3EsQI-ihB48kir-SWN-dohTmYDlkS_arijk5oefS9abiZrIaHPvUdqXhUSqAK2WRgBWbvflWrBKg-b_a3_qR4FGdY-7kaF572RNMEm31wrb4jeEKul5CgqkN13927t4Ye8Z3WXoe9NEOZGBVqh2ukdSJ_pRC9Pe095jawPuI2frdehlUlrHVWM3lLptDIuvlYTNg92OH7xsEDrrnHYC22RYkH3bRe2j4p9I5u-UobhAa2BnB2AEbAgvklwgdFYtG4y2lDmJ1LH4H-qhvCpc", "token_type": "bearer", "expires_in": 59, "refresh_token": "_9agQfp6MK21yZcBsDpqRwBbj9-arJVBAJ7Brg6_KiR8F1Q3Oois7LyymPafL0jpLV-5q30UBQJ96jyOkuNQZCuDaO17k1Ibg8uZsVphUMAnCVhV5zB1DccyArrL_vUrEp8gXml96niqrUNm88Ruialocq0reBmvsBoOPxXGfdaNSB2U5TGNtQFTOBY3qCV6TBSEO9KZvY5FnZ815bl1rjGLxN1AMmPlJAt_yF93dhi0NY6_OzsaVY1ITh7sFSaY2nEjd7hZCDoQ4xo2WHQaGNrfSxtvrM53jysw8ovUQm_oBAWne8AuBhpdwuI4byC1gK5iNFo5yBk69elwA2ezVXukG3JUL8p4q2Zxzmri32Mq4gQVa7lKDkPnucxbSR1uaKjAm4D-GTEx16NavzlOTEpqcstsOL3XKRKAvmykhtjAmU6J8S3o28pFAocnha1ImhWayYXSk3Zfs1mE2v5HVXIECsE00ioKBRCEZhApVrM", "userName": "{userName}", ".issued": "Mon, 08 Aug 2016 06:52:32 GMT", ".expires": "Mon, 08 Aug 2016 06:53:32 GMT" }
With the obtained token the user can then call the api:
Call an endpoint of the api like /v1/Incident/GetIncidents with a GET-request. The header of the call must contain Authorization="bearer {token}", e.g.:
Authorization="bearer HEcectNlLj6OOvwlIbivgiqq-P6wmFW8W_8Y3s3uexbWQT5woBIBqXhBfuHeKw9CooMSnPcTwPAeY-3lie4UJ0SsETit3zzeyrHIip3kZu9Os--ppsM8k7P58AosN6jMlx2ybtbzTZefqfXZpBfW6gDsXPpP97RtfomOH2Jdd-4bTJufoTuwsnmFGWoYS6TaDHKvF4Z-g_c-qnLYc2g6dbYc3EsQI-ihB48kir-SWN-dohTmYDlkS_arijk5oefS9abiZrIaHPvUdqXhUSqAK2WRgBWbvflWrBKg-b_a3_qR4FGdY-7kaF572RNMEm31wrb4jeEKul5CgqkN13927t4Ye8Z3WXoe9NEOZGBVqh2ukdSJ_pRC9Pe095jawPuI2frdehlUlrHVWM3lLptDIuvlYTNg92OH7xsEDrrnHYC22RYkH3bRe2j4p9I5u-UobhAa2BnB2AEbAgvklwgdFYtG4y2lDmJ1LH4H-qhvCpc"