REST API Key Concepts

The following key concepts are associated with REST API.

Login

To begin using the interface, create a function called Login() that uses an HttpClient and sends a POST request to the baseUrl + "/sessions Active login period for a user in WebEOC Nexus, visible to administrators who can view and terminate sessions through Sessions Manager.".

The baseUrl variable represents the address of the REST server. The format for the base URL is https://mywebeocserver/api/rest.svc.

Example:

  • WebEOC Nexus base url: https://county-eoc.webeocasp.com

  • REST endpoint: https://county-eoc.webeocasp.com/county-eoc/api/rest.svc

The string "/sessions" represents the URL parameter for this specific REST endpoint.

You must handle cookies returned by the API. To do this, we recommend using the HttpClientHandler with a CookieContainer to manage the connections.

In the endpoint examples throughout this document, we assume the following code has already been executed:

Copy Code
var cookieContainer = new CookieContainer();
var httpClientHandler = new HttpClientHandler(); 
httpClientHandler.CookieContainer = cookieContainer;

Credentials

The WebEOC Nexus API permissions use the same permissions as the user currently logged in and executing those API calls.

When logging into WebEOC Nexus, four values are required:

  • username – WebEOC Nexus user who will perform the requested operation.

  • password – Password for the user specified by the username.

  • position – Position, such as Director, Logistics Chief, or Safety Officer, that the user will fill while performing the requested operation.

  • Incident – (conditionally required) – WebEOC Nexus incident to log the user into while they are performing the requested operation.

These four values are passed to the REST interface as a JSON object. The credentials variable is serialized into JSON to create the serialized Credentials string.

Methods

All requests sent to the REST interface will have one of the three following methods:

  • GET retrieves information about a resource.

  • POST creates new resources or modifies existing resources.

  • DELETE removes resources.