API Documentation
Authentication (POST)
“https://www.portonhealth.com/api/v1/auth/”
Authentication is an api that is designed to log a user in using an api key obtained from Provider or Employer Organization Admins.
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required String User Email to login onto PortonHealth’s platform Required password String Password of User Required scopes Array Access level of resources, can be read, write, or both Required resources String Resources you want to access Required
{
"apiKey": "sample_api_key",
"email": "patient@porton.com",
"password": "patient_password",
"scopes": ["read", "write"],
"resources": ["appointments"]
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. accessToken String Access token issued temporarily to access other apis. Will expire after 30 minutes and will need to recall the api again to reissue another token. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200,
"accessToken": "fas1d9as2jsd91d01"
}
Appointments (POST)
“https://www.portonhealth.com/api/v1/appointments/”
Appointments is an api that is designed to schedule a request with an existing Porton Doctor obtained from Provider or Employer Organization Admins.
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required doctorEmail String Email of the doctor Required startTime String Moment Time string with timezone support Required duration Number Duration of appointment in minutes Required type String Type of consultation Required specialty String Specialty of the consultation, must be a valid and verified specialty by Porton Health Required description String Simple explanation of symptoms to the doctor Required
{
"apiKey": "2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"doctorEmail": "doctor@porton.com",
"startTime": "2018-06-29T18:57:18-07:00",
"duration": 60,
"type": "Video Consult",
"specialty": "Cardiology",
"description": "this is a simple description"
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200
}
Appointments Index (POST)
“https://www.portonhealth.com/api/v1/appointments/index”
Appointments index is an endpoint for retrieving appointments of a Porton user.
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required
{
"apiKey": "2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L"
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. appointments Array An array of appointments, containing keys for appointment ID, start time, end time, patient name, patient email, and appointment info, all of which are strings. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200,
"appointments": [
{
"_id": "6HB4iGhFiLNbz7mpw",
"start": "2018-12-16T18:00:00-08:00",
"end": "2018-12-16T18:15:00-08:00",
"patientName": "John Doe",
"patientEmail": "jdoe@porton.com",
"info": "Example appointment",
}
]
}
Registration (POST)
“https://www.portonhealth.com/api/v1/register/”
Registration is an api that will allow you to create a Patient in Porton’s platform
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required String Email of the new Patient (Will be used for verification and login) Required password String Password of the user. Must meet the following requirements: – Should contain one digit
– Should contain at least one lower case letter
– Should contain at least one upper case letter
– Should contain at least one special character
– Length should be greater than 8
Required firstName String First Name of the Patient Required lastName String Last Name of the Patient Required birthYear Number Birth year Required gender String One of the following: – Male
– Female
– Male
– Transgender
– Male
– Not listed
– Prefer not to answer
Required allergy String Allergy and conditions Required phone String Contact number the Doctor or PortonHealth may use for contact/verification Optional height Number Height in CM Optional weight Number Weight in KG Optional bloodType String Blood Type of Patient (WARNING: will only be set once, must contact an administrator for change) Optional familyHistory String Hereditary Illnesses / Family conditions the doctor may need to know about Optional
{
"apiKey": "1234567890",
"email": "SpongeBob@KrustyKrabs.com",
"password": "GaryIsLife",
"firstName": "SpongeBob",
"lastName": "SquarePants",
"birthYear": 1990,
"gender" : "Male",
"allergy" : "Allergic to JellyFish",
"phone" : "000 000 0000",
"height" : "100",
"weight" : "100",
"bloodType" : "AB negative",
"familyHistory": "Sponge Anatomy"
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. accessToken String Access token issued temporarily to access other apis. Will expire after 30 minutes and will need to recall the api again to reissue another token. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200
}
Get Reminder Settings (POST)
“https://www.portonhealth.com/api/v1/appointments/reminders/all”
Get Reminder Settings is an api that will allow doctors to get their scheduled reminder settings in Porton’s platform
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required
{
"apiKey": "2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L"
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. reminders Object An object that contains the doctorId and three objects, representing email, sms, and voice reminder settings. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200,
"reminders": {
"_id": "YC25NAFyRj8f4XBSu",
"doctorId": "peT2PWmpYdFb9k8he",
"email": {
"messageType": "text",
"message": "This is an email reminder message.",
"daysBeforeReminder": "1",
"on": true
},
"sms": {
"messageType": "text",
"message": "This is an SMS reminder message.",
"daysBeforeReminder": "1",
"on": true
},
"voice": {
"messageType": "recording",
"message": {
"fileName": "RecordingReminderMessage.mp3",
"fileDirectUrl": "https://example-url.com/jxFLTABrXNDonzfaa.mp3",
"isRecording": true
},
"daysBeforeReminder": "1",
"on": true
}
}
}
Schedule Reminders (POST)
“https://www.portonhealth.com/api/v1/appointments/reminders”
Schedule Reminders is an api that will allow doctors to schedule reminders in Porton’s platform
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required reminderType String One of the following: – voice
– sms
Required messageType String One of the following: – text
– recording
Required message String Should contain at least one character Required daysBeforeReminder Number Should be an integer between 1 – 30 Required on Number One of the following (defaults to 1 if unspecified): – 1
– 0
Optional
{
"apiKey": "1234567890",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"reminderType": "sms",
"messageType": "text",
"message": "This is a reminder to all patients.",
"daysBeforeReminder": 1
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200,
}
Send Reminder (POST)
“https://www.portonhealth.com/api/v1/appointments/reminder”
Send Reminder is an api that will allow doctors to send a reminder in Porton’s platform
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required requestId String Id of the appointment that you want a reminder for Required reminderType String One of the following: – voice
– sms
Required messageType String One of the following: – text
– recording
Required message String Should contain at least one character Required
{
"apiKey": "1234567890",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"requestId": "1234567890",
"reminderType": "sms",
"messageType": "text",
"message": "This is a reminder to a particular appointment."
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200
}
Switch On/Off Reminder (POST)
“https://www.portonhealth.com/api/v1/appointments/reminders”
Switch On/Off Reminder is an api that will allow doctors to switch on/off their reminders in Porton’s platform
Key Type Description Field apiKey String API Key issued by Provider/Employer Organization Admin Required accessToken String Access Token issued by the authentication api Required reminderType String One of the following: – voice
– sms
Required on Number One of the following: – 1
– 0
Required
{
"apiKey": "1234567890",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"reminderType": "sms",
"on": 0
}
Key Type Description status Number One of 200, 400. Represents the status of the request. 200 means success. message String If request failed, message will give developers/users a meaningful response about why the request failed.
{
"status": 200
}