SOFTWARE: API
MIT License
Copyright (c) 2019 - NYUAD IGEM 2019
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WHAT IS AN API?
An API (Application Programming Interface) simply put is a way for applications to communicate with each other. It is a system used to store data that can be easily accessed by the intended individuals from some type of database system.
INSPIRATION
The need for an API for the Volatect device came about as we needed a method to get the data collected from airports to be securely accessible to researchers without risking the loss of personal passenger information. The paper, “An extensible framework and database of infectious disease for biosurveillance” authored by Ashlynn R. Daughton in 2017 expresses the importance of biosurveillance, and details a system that allows the creation of organized data system to aid the detection of outbreaks.
USE
The Volatect API is intended to be used by medical researchers. We believe that the data that comes out of air travel disease reports from our device could help immensely in the analysis and prediction of outbreaks around the world as we provide disease diagnosis in relation to the nationality and the flight path of the passengers.
SECURE?
The Volatect API is built according to the REST API standards. Firstly, the API requests take place through a secure SSL channel as we use the recognized https standards. In order to secure the personal passenger information we were inspired by the Google Cloud HealthCare API which uses, “De-identification” to protect sensitive data. Therefore, we use 256bit AES Encryption on any sensitive data we have on the server such as passport numbers so only the Airport control has access to the encrypted data.
HOW TO CALL THE API?
The most simplest way to get all the data that the Volatect Device has collected would be to go to https://igem-nyuad-api.herokuapp.com/request. Once opened, it will request for all the information collected on the device and display it in a JSON format which can be used either programmatically or using software for visualization and analysis.
GETTING MORE SPECIFIC DATA
To get more specific data, you can play with the url path, we allow:
request/by/disease/Malaria
request/by/nationality/Omani
request/by/airportCode/JFK
request/order/by/time/desc
request/order/by/time/asc
Where the text in yellow can be swapped with the information you need. For example, opening https://igem-nyuad-api.herokuapp.com/request/by/disease/Malaria will request and display the data of passengers who at least have Malaria.
Data response is always in JSON format. Data can be programmatically retrieved using the terminal / command line interface using the curl command.
For example: curl -X GET https://igem-nyuad-api.herokuapp.com/request/
Running this command would retrieve all the data in the terminal itself giving you the
JSON response.
Data can also be retrieved more simply as mentioned in the non-technical
documentation by using a browser that has a graphical user interface.
1.1 Request all data
Permissions Required |
None |
Pathway |
/request |
HTTP TYPE |
GET |
Usage |
Will return all the data in the database |
Example url path: |
1.2 Request all data ordered by time recorded
Permissions Required |
None |
Pathway |
/request/order/by/time/{ORDER TYPE} |
HTTP TYPE |
GET |
{ORDER TYPE} Parameter options |
desc,asc Where desc is for the records with the latest first, asc with the oldest records first. |
Usage |
Will return all the data in the database in a specified order. |
Example url path: |
https://igem-nyuad-api.herokuapp.com/request/order/by/time/desc |
1.3 Request all data for a specific disease
Permissions Required |
None |
Pathway |
/request/by/disease/{Disease Name} |
HTTP TYPE |
GET |
{Disease Name} Parameter options |
malaria,hepatitisB,whoopingCough, tuberculosis, plague
|
Usage |
Will return all the data in the database where passengers have the disease {Disease Name} |
Example url path: |
https://igem-nyuad-api.herokuapp.com/request/by/disease/malaria |
1.4 Request all data from passengers of a specific nationality
Permissions Required |
None |
Pathway |
/request/by/nationality/{Nationality} |
HTTP TYPE |
GET |
{Nationality} Parameter options |
2 Letter Abbreviation Code for countries. For a list of them all please visit: https://datahub.io/core/country-list |
Usage |
Will return all the data in the database where passengers have the disease {Disease Name} |
Example url path: |
https://igem-nyuad-api.herokuapp.com/request/by/disease/malaria |
1.5 Request all data from passengers by airportCode
Permissions Required |
None |
Pathway |
/request/by/airportCode/{Airport Code} |
HTTP TYPE |
GET |
{Airport Code} Parameter options |
3 Letter IATA Code for Airports. For a list of them all please visit: https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A |
Usage |
Will return all the data in the database where passengers have been recorded at the airport with the code: {Airport Code} |
Example url path: |
https://igem-nyuad-api.herokuapp.com/request/by/airportCode/MCT |
1.6 Add record into database
Permissions Required |
Super Access. Requires API KEY |
||||||||||||||||||||||||||||||
Pathway |
/request |
||||||||||||||||||||||||||||||
HTTP TYPE |
POST |
||||||||||||||||||||||||||||||
Parameter options |
|
||||||||||||||||||||||||||||||
Usage |
Will add the data that was sent through the request parameters to the database. This request would happen directly from the Volatect device in the airport. |
||||||||||||||||||||||||||||||
Example url path: |
System Specifications
We use Heroku as a hosting server of our API and database. The database system used is Heroku Postgres SQL.
Database Schema
Column Name |
Column Type |
Nullable |
Primary Key |
Identifier |
text |
Not null |
Primary Key |
Time |
timestamp |
Not null |
|
AirportCode |
text |
Not null |
|
Malaria |
int |
Not null |
|
HepatitisB |
int |
Not null |
|
WhoopingCough |
int |
Not null |
|
Tuberculosis |
int |
Not null |
|
Plague |
int |
Not null |
|
Nationality |
int |
Not null |
|
FromAirportCode |
text |
Not null |
|
ToAirportCode |
text |
Not null |
|
"diseasedatabase_pkey" PRIMARY KEY, btree (identifier) |