API Documentation

Authentication (POST)
Authentication is an API that is designed to log a user in using an API key obtained from Provider or Employer Organization Admins.
Request Information
Key | Type | Description | Field |
---|---|---|---|
apiKey | String | API Key issued by Provider /Employer Organization Admin | Required |
String | User Email to login onto Porton Health’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 |
Sample Request
{
“apiKey”: “sample_api_key”,
“email”: “patient@porton.com”,
“password”: “patient_password”,
“scopes”: [“read”, “write”],
“resources”: [“appointments”]
}
Request Response
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 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 |
Sample Request Body
{
“status”: 200,
“accessToken”:
“fas1d9as2jsd91d01”
}
Appointments (POST)
Appointments is an API that is designed to schedule a request with an existing Porton Doctor obtained from Provider or Employer Organization Admins.
Request Information
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 |
speciality | 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 |
Sample Request
{
“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”
}
Request Response
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 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 |
Sample Request Body
{
“status”: 200,
“accessToken”:
“fas1d9as2jsd91d01”
}
Appointments (POST)
Appointments is an API that is designed to schedule a request with an existing Porton Doctor obtained from Provider or Employer Organization Admins.
Request Information
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 |
Sample Request
{
“apiKey”: “2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618”,
“accessToken”: “5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L”,
}
Request Response
Key | Type | Description |
---|---|---|
status | Number | One of 200, 400. Represents the status of the request. 200 means success. |
appointment | String | 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. |
Sample Request Body
{
“status”: 200,
“appointment”: [
{
“_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)
Registration is an API that will allow you to create a Patient in Porton’s platform.
Request Information
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 |
allergy | String | Allergy and conditions | Required |
phone | String | Contact number the Doctor or Porton Health 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 |
Sample Request Body
{
“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”
}
Request Response
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. |
Sample Request Body
{
“status”: 200
}
Get Reminder Settings (POST)
Get Reminder Settings is an API that will allow doctors to get their scheduled reminder settings in Porton’s platform
Request Information
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 |
Sample Request Body
{
“apiKey”: “2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618”,
“accessToken”: “5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L”
}
Request Response
Key | Type | Description |
---|---|---|
status | Number | One of 200, 400. Represents the status of the request. 200 means success. |
reminder | 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. |
Sample Request Body
{
“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)
Schedule Reminders is an API that will allow doctors to schedule reminders in Porton’s platform
Request Information
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 | Required |
Sample Request Body
{
“apiKey”: “1234567890”,
“accessToken”: “5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L”,
“reminderType”: “sms”,
“messageType”: “text”,
“message”: “This is a reminder to all patients.”,
“daysBeforeReminder”: 1
}
Request Response
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. |
Sample Request Body
{
“status”: 200,
}
Send Reminder (POST)
Send Reminder is an API that will allow doctors to send a reminder in Porton’s platform
Request Information
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 |
Sample Request Body
{
"apiKey": "1234567890",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"requestId": "1234567890",
"reminderType": "sms",
"messageType": "text",
"message": "This is a reminder to a particular appointment."
}
Request Response
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. |
Sample Request Body
{
“status”: 200,
}
Switch On/Off Reminder (POST)
Switch On/Off Reminder is an API that will allow doctors to switch on/off their reminders in Porton’s platform
Request Information
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 |
message | String | Should contain at least one character | Required |
Sample Request Body
{
"apiKey": "1234567890",
"accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
"reminderType": "sms",
"on": 0
}
Request Response
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. |
Sample Request Body
{
“status”: 200,
}