Extra Information
Please note that all requests made to the API require an API key as part of the URL except for the login endpoints. For example:
POST /api/users/create.php?key={apiKey} GET /api/users/read-all.php?key={apiKey} GET /api/users/read-range.php?from={patientID}&to={patientID}&key={apiKey} GET /api/falls/read-date.php?id={patientID}&from={fall_date}&to={fall_date}&key={apiKey}
While in development mode, a hardcoded API key can be used (which can be found on Teams). When development mode is disabled, session tokens act as API keys, with admin tokens being able to access all endpoints.
Users
POST
/api/users/create.php
researcherID patient_nhsRef patient_username patient_password patient_fName patient_lName patient_dob patient_addressI patient_addressII patient_postcode patient_tel patient_mobile patient_email patient_comment
Create a user.
GET
/api/users/read.php?id={patientID}
patientID
Get the details of one user.
GET
/api/users/read-all.php
Get the details of every user.
GET
/api/users/read-range.php?from={patientID}&to={patientID}
patientID
Get the details of users within a patientID range.
PUT
/api/users/update.php
researcherID patient_nhsRef patient_username patient_password patient_fName patient_lName patient_addressI patient_addressII patient_postcode patient_tel patient_mobile patient_email patient_comment
Update a user's details. The NHS number is used to determine which user to update the details of.
DELETE
/api/users/delete.php
patientID
Delete a user.
POST
/api/users/login.php
patient_username patient_password fcmToken
Log a user into the system.
POST
/api/users/logout.php
patientID
Log a user out of the system.
GET
/api/users/verify.php
Verify a user's session token.
Falls
POST
/api/falls/create.php
patientID
falls
Record a user's fall.
GET
/api/falls/read.php?id={fallID}
fallID
Get the details of one fall.
GET
/api/falls/read-all.php
Get the details of every fall.
GET
/api/falls/read-all-date.php
Get the details of every fall between two dates.
GET
/api/falls/read-user.php?id={patientID}
patientID
Get the details of a user's every fall.
GET
/api/falls/read-date.php?id={patientID}&from={fall_date}&to={fall_date}
patientID fall_date
Get the details of a user's every fall between two dates.
DELETE
/api/falls/delete.php
fallID
Delete a user's fall.
GET
/api/falls/export.php?id={patientID}
patientID
Export the falls data of a user.
GET
/api/falls/export-all.php
Export the falls data of all users.
Diary Entries
POST
/api/diary-entries/create.php
patientID entry
Create a diary entry.
GET
/api/diary-entries/read.php?patientID={patientID}&entryID={entryID}
patientID entryID
Get the details of one diary entry.
GET
/api/diary-entries/read-all.php
Get the details of every diary entry.
GET
/api/diary-entries/read-user.php?id={patientID}
patientID
Get the details of a user's every diary entry.
GET
/api/diary-entries/read-date.php?id={patientID}&from={entry_date}&to={entry_date}
patientID entry_date
Get the details of a user's every diary entry between two dates.
PUT
/api/diary-entries/update.php
patientID entryID entry
Update a user's diary entry.
DELETE
/api/diary-entries/delete.php
patientID entryID
Delete a user's diary entry.
Questions
POST
/api/questions/create.php
patientID question question_charLim question_type choices
Create a question for a user. The "choices" piece of data would be an array.
POST
/api/questions/create-all.php
question question_charLim question_type choices
Create a question for all users. The "choices" piece of data would be an array.
GET
/api/questions/read.php?id={questionID}
questionID
Get the details of one question.
GET
/api/questions/read-all.php
Get the details of every question.
GET
/api/questions/read-range.php?from={questionID}&to={questionID}
questionID
Get the details of every question within a range of IDs.
PUT
/api/questions/update.php
questionID question question_charLim question_type choices
Update the details of a question. The questionID is used to determine which question to edit the details of, the ID itself cannot be changed.
DELETE
/api/questions/delete.php
questionID
Delete a question.
Answers
POST
/api/answers/create.php
questionID patientID answer
Create an answer.
GET
/api/answers/read.php?id={answerID}
answerID
Get the details of one answer.
GET
/api/answers/read-range.php?from={questionID}&to={questionID}
questionID
Get the details of every answer within a range of IDs.
GET
/api/answers/read-all.php
Get the details of every answer.
GET
/api/answers/read-user.php?id={patientID}
patientID
Get the details of a user's every answer.
PUT
/api/answers/update.php
patientID answerID answer
Update the details of an answer. The answerID is only used to determine which answer to update the details of, the ID itself cannot be changed.
DELETE
/api/answers/delete.php
answerID
Delete an answer.
Admins
POST
/api/admins/create.php
researcher_nhsRef researcher_username researcher_password researcher_fName researcher_lName researcher_tel researcher_mobile researcher_email
Create an admin.
GET
/api/admins/read.php?id={researcherID}
researcherID
Get the details of one admin.
GET
/api/admins/read-all.php
Get the details of every admin.
GET
/api/admins/read-range.php?from={researcherID}&to={researcherID}
researcherID
Get the details of admins within a researcherID range.
PUT
/api/admins/update.php
researcher_nhsRef researcher_username researcher_password researcher_fName researcher_lName researcher_tel researcher_mobile researcher_email
Update an admin's details. The NHS number is used to determine which admin to update the details of.
DELETE
/api/admins/delete.php
researcherID
Delete an admin.
POST
/api/admins/login.php
researcher_username researcher_password
Log an admin into the system.
POST
/api/admins/logout.php
researcherID
Log an admin out of the system.
GET
/api/admins/verify.php
Verify an admin's session token.