GET
- /<adminkey>
Description: Master Data
Parameter: Admin Key - accessible and regenerated by maintainer
Response: All Patient data in JSON
Example - https://healthconnect-server.onrender.com/xxxxxxxxxxxxxxx
{
"patient": [
{
"_id": "12j31k2j3lxxxxfe7d234d261",
"Name": "txxxxxa",
"Address": "xxxxxx",
"Age": 21
},
{
"_id": "6d3ff17xxxxfe72d421",
"Name": "qxxxxxa",
"Address": "xxxxxx",
"Age": 24
},
{
"_id": "54g656ff3xxxxfe7d234d2e661",
"Name": "pAxxxxxa",
"Address": "xxxxxx",
"Age": 35
}
]
}
GET
- /patient/<id>
Description: To get Patient data with 'id'
Parameter: ID - accessible by patient after login
Response: Patient data with particular ID
Example - https://healthconnect-server.onrender.com/patient/xxxxxxxxxxxxxxxxxxx
{
"patient":
{
"_id": "2cdgdxxxxxxxxxxxx83da84",
"Name": "Elon Musk",
"Address": "Texas",
"Age": 24,
"Ambulation": false
}
}
GET
- /geo_locate/:user
Description: To get Geo-API key, used for third party API service
Parameter: user - track number of uses and auto-update API accordingly
Response: geo_api - secret key in JSON
Example - https://healthconnect-server.onrender.com/geo_locate/elon
{
"geo_api": "93h4hd3xxxxxxwe9w382295a"
}
GET
- /login?user=<user>&pass=<pass>
Description: To get JIT token with 'user' & 'pass'
Parameter: user & pass - original client key
Response: JIT Token
Example - https://healthconnect-server.onrender.com/login?user=elon&pass=xxxx
{
"token":"56d67fb18d4c07e851c29896172797a75bbc32ec2b0f3931ad5521218c3131e4"
}
GET
- /data?user=<user>&token=<JIT_token>
Description: To get patient data with 'user' & 'token'
Parameter: user & token (generated by respose during login)
Response: Patient Information with provided username - authenticated by token
Example - https://healthconnect-server.onrender.com/data?user=elon&token=xxxxxxxxxxxxxxxx
{
"patient":
{
"_id": "2cdgdxxxxxxxxxxxx83da84",
"Name": "Elon Musk",
"Address": "Texas",
"Age": 24,
"Ambulation": false
}
}
POST
- /patient/signup
Description: To create new patient - Using user and pass is required.
Request: JSON Body with Patient Information
Response: Patient Created
Request Body -
{
"newpatient": {
"Name": "Axxxxxa",
"Email": "[email protected]",
"DOB": "1/12/1999",
"Address": "xxxxxx",
"Contacts": "8xxxxxx828",
"BGroup": "O+",
"Sex": "Male",
"pass": "xxxx",
"user": "elon"
}
}
Response -
{
"message": "Patient Created"
}
PUT
- /patient/update/<id>
Description: To Update a Patient Information
Parameter: ID - accessible by patient after login
Request: JSON Body with new data
Response: New Patient Information
Request Body -
{
"patientData":{
"BMI": 78
}
}
Response -
{
"message": "Patient Data updated!"
}
PUT
- /patient/update-health/<id>
Description: To Update a Patient Health Data
Parameter: ID - Patient's unique ID after login
Request: JSON Body with new data
Request Body -
{
"healthData": {
"StepCount": [
{
"date": "2025-03-23T08:00:00Z",
"value": 5000
},
{
"date": "2025-03-22T09:00:00Z",
"value": 6000
}
],
"Water": [
{
"date": "2025-03-23T10:00:00Z",
"value": 2
}
]
}
}
Response -
{
"message": "Health Updated π"
}
DELETE
- /patient/delete/<id>
Description: To Update a Patient Information
Parameter: ID - accessible by patient after login
Response -
{
"message": "Patient Deleted πͺ"
}
GET
- /devtkn/create?user=<user>&pass=<pass>
Description: To Create New Device token
Parameter: user and pass for authentication
Response -
{
"device_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"time": "D/MM/YYYY HH:MM:SS AM/PM",
}
GET
- /devtkn/portal?user=<user>&token=<session_token>
Description: To Request MQTT server Information
Parameter: user & session_token - session token is used as API key for the user (generated upon JIT Token)
Response -
{
"mqttserver": "xxxxx.xxxxx.xxxxx",
"mqttUser": "xxxxxxxxxxx",
"mqttPass": "xxxxxxxxxxx"
}
GET
- /devtkn/device?user=<user>&token=<dev_token>
Description: To Request MQTT server Information
Parameter: user & dev_token - device token is used as API key for the user
Response -
{
"mqttserver": "xxxxx.xxxxx.xxxxx",
"mqttUser": "xxxxxxxxxxx",
"mqttPass": "xxxxxxxxxxx"
}
POST
- /node/create?user=<user>&token=<dev_token>
Description: To create NEW node device, node-xxxxxxx to be stored and used for data-exchange
Parameter: user & dev_token - device token is used as API key for the user
Request: JSON Body with new data
Response: Node Created message
Request Body -
{
"nodeData":
{
"devices":
{
"node": "node-XXXXXXXX",
"type": "xxxxx",
"attribute": "sbp"
}
}
}
Response -
{
"message": "Node Created π"
}
GET
- /node/device?user=<user>&token=<dev_token>&node=<device_id>
Description: To view node data
Parameter: user, dev_token & node device
Response: Node Information
Response -
{
"node": "node-xxxxxxx",
"attribute": "xxxx, xxxx"
}
PUT
- /update/health
Description: To Update a Patient Health Data with device token
Parameter: user & dev_token
Request: JSON Body with new data
Request Body -
{
"healthData": {
"StepCount": [
{
"date": "2025-03-23T08:00:00Z",
"value": 5000
},
{
"date": "2025-03-22T09:00:00Z",
"value": 6000
}
],
"Water": [
{
"date": "2025-03-23T10:00:00Z",
"value": 2
}
]
}
}
Response -
{
"message": "Health Updated π"
}
DELETE
- /node/delete?user=<user>&token=<dev_token>&node=<device_id>
Description: To delete Node Data
Parameter: user, dev_token & node device
Response: Node Deleted
Response -
{
"message": "Node Deleted πͺ"
}