SWIM API
Current Version: 2.4
Language: Javascript (NodeJS)
Introduction
The SWIM API is the main backend service for the SWIM user interface and provides secure access to the SWIM modeling database. It allows the retrieval of model metadata, input parameters, output variables, scenario themes, and saved model executions.
Additionally, the API provides modules for user authentication and event log handling.
Swagger UI
The Swagger UI provides documentation and samples to access the SWIM Recommender API endpoints. The documentation interface is available by clicking below:
Try it out
All of the SWIM API endpoints require token authentication. Tokens can be requested through the API endpoints as a registered or guest user with the following endpoints:
- Guest token request: https://services.cybershare.utep.edu/swim-api/swim-auth-api/authenticateGuest
- Registrant token request: https://services.cybershare.utep.edu/swim-api/swim-auth-api/authenticateGuest
A) To get a registrant user account do the following:
- Navigate to https://purl.org/swim
- On the main menu bar select the Login dropdown.
- Click on the register button to see the registration form.
- Fill out the form with the requested information.
- If the submission process is successfull you may use the account credentials straight away.
B) To generate a token and try the SWIM API docs page:
- Navigate to the API docs page at https://services.cybershare.utep.edu/swim-api/api-docs/
- Scroll down to the path called /swim-auth-api to see the authentication endpoints.
- To authenticate as a registrant click on the /swim-auth-api/authenticate endpoint.
-
Click on the try out button.
-
Replace the "string" words with your user email and password and click the execute button.
-
Copy the idToken portion of the response after "JWT" without spaces and final quotes (hidden red text).
-
Scroll to the top of the page and click on the Authorize button.
-
Fill in the value field by pasting the authentication token.
-
Click on the authorize button.
- You can now use the rest of the endpoints identified by the lock icon. Note that some endpoints may require a higher access level, contact us if a higher access level is required.