Web API

This page summarizes the API endpoints that are exposed by different ICUBAM services. Note that you may need a prefix to the listed URLs depending on the deployment options (and in particular the base_url config parameter of each service).

Main service

GET /

Shows the map with ICUS. Requires the user to be authenticated.

GET /map

Shows the map with ICUS. Same as / endpoint but accessed with an API KEY.

Query Parameters:
 
  • API_KEY – a valid API KEY of type MAP or ALL.
GET /version

Returns the current version.

Example response

{'data': {
   'version': 'v0.5.1',
   'git-hash': '7416eefc',
   'bed_counts.last_modified': '2020-05-29 12:00'
   }
 }

A HTTP page with consent handler.

GET /disclamer

Shows a disclaimer page specified in the configuration.

GET /error

Renders the error template.

GET /update

Get a form to update bed counts information for an ICU

Query Parameters:
 
  • id – authentication token which encodes user id and ICU id.
GET /dashboard
Query Parameters:
 
  • API_KEY – a valid API KEY of type STATS or ALL.

Analytics service

GET /db/(str: resource)

Export a given resource. Supported resources are bedcounts, all_bedcounts, icus, regions.

Query Parameters:
 
  • format – The format of the response. Possible values are csv or html.
  • max_ts – Maximum timestamp for the response.
  • API_KEY – a valid API KEY of type STATS or ALL.
POST /db/(str: resource)

Import a given resource. The only supported resource is bedcounts at present.

Query Parameters:
 
  • API_KEY – a valid API KEY of type STATS or ALL.
  • format – File format. Must be set to ror_idf.

Backoffice service

The backoffice server does not expose a public API and is intended to be used a web application directly.

Messaging service

POST /onoff

Enable or disable messaging for a set of users. The information is encoded in the request body as a JSON containing user_id, icu_ids and od fields.

GET /schedule

This handler returns all the scheduled messages information.