M2M REST API
The M2M REST API offers a way of programmatically interact with the WICE portal. Only a subset of the functionalities in the portal GUI is available in the API but the long term goal is to have as many features as possible also available in the API.
The API is available at https://wice.alkit.se/m2m/ (or by appending /m2m for each customer specific installation of wice) and a description of each available end point can be found at that URL.
Authentication
All end points (except the login end points) in the API are secured which means that a user needs to login and obtain an authentication token that has to be provided in each request to the secured end points.
To obtain a token the following steps have to be completed:
- Enable m2m access for the user of interest. This is done via the GUI and the Edit_User_Dialog.
- Provide the username and password to one of the login end points (https://wice.alkit.se/m2m/resource_AuthService.html) to get the token. There are currently two login end points available. One which returns the token as a header in the response, "auth-token". The other one returns the token as plain text. Some frameworks have the option to include response headers in subsequent requests which may make the first end point more convenient.
- Provide the token as the "auth-token" header to any request to a secured end point.
The token will be automatically be invalidated if it has not been used for 8 hours. The same token can also be used for parallel requests.
Editing of assignments
Currently only editing of Signal reader assignments is possible via the API. A description of a use case can be found here.