Categories

  • Name
    Value
    Description
  • trafficSituation_Black
    11
    Incidents involving road closures
  • trafficSituation_Red
    12
    Incidents involving traffic jam (stopped traffic)
  • trafficSituation_Orange
    13
    Incidents involving traffic congestion or obstructions
  • trafficSituation_Green
    14
    Clearance of a wrong-way Driver
  • roadCondition_Orange
    21
    Roads with closures or obstructions due to difficult road conditions
  • roadWorks_Orange
    31
    Roadworks
  • roadWorks_Norange
    32
    Roadworks only during nighttime
  • pass_Black
    41
    Closed mountain passes
  • pass_Orange
    43
    Mountain passes with difficult road conditions
  • pass_Green
    44
    Open mountain passes
  • cartransport_Black
    61
    Closed cartrain stations
  • cartransport_Red
    62
    Cartrain stations with waiting time
  • cartransport_Orange
    63
    Cartrain stations with difficult road conditions
  • cartransport_Green
    64
    Cartrain stations in normal and open state
  • alert
    90
    Incidents involving highly dangerous situations
  • parking
    71
    Parking related information
  • webcams
    80
    Webcams related information

Authentication

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.

Obtain a token

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"
}

  • The field access_token contains the actual token.
  • The field expires_in contains the duration of the token in seconds. Per default tokens are valid for one minute.
  • The field refresh_token can be used to refresh the token.

Call api with a token

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"