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.

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
emailStringUser Email to login onto PortonHealth’s platformRequired
passwordStringPassword of UserRequired
scopesArrayAccess level of resources, can be read, write, or bothRequired
resourcesStringResources you want to accessRequired
Sample Request Body
{
  "apiKey": "sample_api_key",
  "email": "patient@porton.com",
  "password": "patient_password",
  "scopes": ["read", "write"],
  "resources": ["appointments"]
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
accessTokenStringAccess token issued temporarily to access other apis. Will expire after 30 minutes and will need to recall the api again to reissue another token.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200,
  "accessToken": "fas1d9as2jsd91d01"
}
Updated On June 1st 2018

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.

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
doctorEmailStringEmail of the doctorRequired
startTimeStringMoment Time string with timezone supportRequired
durationNumberDuration of appointment in minutesRequired
typeStringType of consultationRequired
specialtyStringSpecialty of the consultation, must be a valid and verified specialty by Porton HealthRequired
descriptionStringSimple explanation of symptoms to the doctorRequired
Sample Request Body
{
  "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
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200
}
Updated On June 1st 2018

Appointments Index (POST)

“https://www.portonhealth.com/api/v1/appointments/index”

Appointments index is an endpoint for retrieving appointments of a Porton user.

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
Sample Request Body
{
  "apiKey": "2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618",
  "accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L"
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
appointmentsArrayAn array of appointments, containing keys for appointment ID, start time, end time, patient name, patient email, and appointment info, all of which are strings.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "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",
    }
  ]
}
Updated On December 19, 2018

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

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
emailStringEmail of the new Patient (Will be used for verification and login)Required
passwordStringPassword 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
firstNameStringFirst Name of the PatientRequired
lastNameStringLast Name of the PatientRequired
birthYearNumberBirth yearRequired
genderStringOne of the following:

– Male

– Female

– Male

– Transgender

– Male

– Not listed

– Prefer not to answer

Required
allergyStringAllergy and conditionsRequired
phoneStringContact number the Doctor or PortonHealth may use for contact/verificationOptional
heightNumberHeight in CMOptional
weightNumberWeight in KGOptional
bloodTypeStringBlood Type of Patient (WARNING: will only be set once, must contact an administrator for change)Optional
familyHistoryStringHereditary Illnesses / Family conditions the doctor may need to know aboutOptional
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
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
accessTokenStringAccess token issued temporarily to access other apis. Will expire after 30 minutes and will need to recall the api again to reissue another token.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200
}
Updated On June 1st 2018

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

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
Sample Request Body
{
  "apiKey": "2f7ff9da0e985fcc94ba8cefc61ac1121dba0a9fe76ea80a2a6e13e9007ed35e36d2f7fb888428d2df71f8b9e3b7e7214da5e99b0e33d82f7b7828bd21867618",
  "accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L"
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
remindersObjectAn object that contains the doctorId and three objects, representing email, sms, and voice reminder settings.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response 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
    }
  }
}
Updated On December 20th 2018

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

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
reminderTypeStringOne of the following:

– voice

– sms

– email

Required
messageTypeStringOne of the following:

– text

– recording

Required
messageStringShould contain at least one characterRequired
daysBeforeReminderNumberShould be an integer between 1 – 30Required
onNumberOne of the following (defaults to 1 if unspecified):

– 1

– 0

Optional
Sample Request Body
{
  "apiKey": "1234567890",
  "accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
  "reminderType": "sms",
  "messageType": "text",
  "message": "This is a reminder to all patients.",
  "daysBeforeReminder": 1
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200,
}
Updated On December 20th 2018

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

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
requestIdStringId of the appointment that you want a reminder forRequired
reminderTypeStringOne of the following:

– voice

– sms

– email

Required
messageTypeStringOne of the following:

– text

– recording

Required
messageStringShould contain at least one characterRequired
Sample Request Body
{
  "apiKey": "1234567890",
  "accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
  "requestId": "1234567890",
  "reminderType": "sms",
  "messageType": "text",
  "message": "This is a reminder to a particular appointment."
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200
}
Updated On December 20th 2018

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

Request Information
KeyTypeDescriptionField
apiKeyStringAPI Key issued by Provider/Employer Organization AdminRequired
accessTokenStringAccess Token issued by the authentication apiRequired
reminderTypeStringOne of the following:

– voice

– sms

– email

Required
onNumberOne of the following:

– 1

– 0

Required
Sample Request Body
{
  "apiKey": "1234567890",
  "accessToken": "5GhXgY6uNAhu96Yu5Kx27pWe3NCKAhpPA7dsWRNAEzrWHHwbK8RhsRaAzPYCzT8L",
  "reminderType": "sms",
  "on": 0
}
Request Response
KeyTypeDescription
statusNumberOne of 200, 400. Represents the status of the request. 200 means success.
messageStringIf request failed, message will give developers/users a meaningful response about why the request failed.
Sample Response Body
{
  "status": 200
}
Updated On December 20th 2018