Telehealth Public APIs
  1. General APIs
Telehealth Public APIs
  • Introduction
  • SSO Login
    • Generate SSO token
      POST
    • SSO Login
      GET
  • General APIs
    • Create Patient
      POST
    • Upload Patient File
      POST
    • Submit Patient's Form Response
      POST
    • Lab readings
      POST
    • Assign Service to Patient
      POST
    • Create Patient's Chart Note
      POST
    • Get Provider's Appointment Slots
      POST
    • Provider Sign Up
      POST
    • GraphQL Get Patient(s)
      POST
  1. General APIs

Submit Patient's Form Response

POST
/api/service/v1/patient/form
To submit patient's form response. If the form response has any File Uploads, please invoke the "Upload Patient File" API first. In response of the "Upload Patient File" API, you will get the D2D's unique id's of the uploaded files. Use those id's to construct the form_response body parameter of this API.
Path Variables: None
Query Parameters: None
Body Parameters:
FieldTypeDescription
patient_idintegerRequired. Id of patient returned from create patient API.
patient_form_namestringRequired. Patient form name.
form_responsesarrayRequired. Array of responses to the questionnaire. Questions are of type "single_option", "multiple_option", "dropdown", "dropdown_with_multiselect", "description", "table", "text", "numbers_only", "date" and "file". How to construct response of every question type is described below.
single_option:
Questions with option to select only one answer. Answer can contain nested questions of type "single_option", "description" or "date".
FieldTypeDescription
question_typestringRequired. Must be "single_option".
textstringRequired. Question text.
answerarrayRequired. Contains answer text and "sub-question" (if any) of type "single_option", "description" or "date"
"single_option" examples:
{
    "question_type": "single_option",
    "text": "Have you seen us before?",
    "answer": {
        "text": "This is my first consult for depression or anxiety",
        "subquestion": {
            "question_type": "single_option",
            "text": "Have you ever used prescription medicines to help treat cold sores? If yes, which one and what dose? Select all that apply to you.",
            "answer": {
                "text": "I have not taken any prescription medicine for cold sores",
                "subquestion": {
                    "question_type": "description",
                    "text": "Please tell us more",
                    "answer": {
                        "text": "I have not taken any prescription medicine for cold sores"
                    }
                }
            }
        }
    }
}
{
    "question_type": "single_option",
    "text": "Have you ever used prescription medicines to help treat cold sores?",
    "answer": {
        "text": "Yes",
        "subquestion": {
            "question_type": "date",
            "text": "Please specify the date you've used it",
            "answer": {
                "text": "2021-01-20"
            }
        }
    }
}
{
    "question_type": "single_option",
    "text": "Have you ever used prescription medicines to help treat cold sores?",
    "answer": {
        "text": "Yes"
    }
}
multiple_option:
Questions with option to select multiple answers. Answer(s) can contain nested questions of type "single_option", "description".
FieldTypeDescription
question_typestringRequired. Must be "multiple_option".
textstringRequired. Question text.
answermulti-dimentional arrayRequired. Contains array of answers. Answer can contain text and "sub-question" (if any) of type "single_option" or "description".
"multiple_option" examples:
{
    "question_type": "multiple_option",
    "text": "What is the reason you are using Doctodoor today?",
    "answer": [
        {
            "text": "Want prescription medicine to take as needed when a cold sore outbreak happens (PRN)",
            "subquestion": {
                "question_type": "single_option",
                "text": "When you have a cold sore outbreak and you don't take medicine, where are your cold sores located? Select all that apply to you.",
                "answer": {
                    "text": "On the lips or the edge / border of the lips"
                }
            }
        },
        {
            "text": "Other",
            "subquestion": {
                "question_type": "description",
                "text": "Please tell us more.",
                "answer": {
                    "text": "Some other text inserted by user"
                }
            }
        }
    ]
}
{
    "question_type": "multiple_option",
    "text": "What is the reason you are using Doctodoor today?",
    "answer": [
        {
            "text": "Want prescription medicine to take as needed when a cold sore outbreak happens (PRN)"
        },
        {
            "text": "Other"
        }
    ]
}
dropdown:
Questions with option to select only one answer. Answer cannot contain any subquestion.
FieldTypeDescription
question_typestringRequired. Must be "dropdown".
textstringRequired. Question text.
answerarrayRequired. Contains only "text" element inside
"dropdown" example:
{
    "question_type": "dropdown",
    "text": "If you don’t take medicine, do you develop blisters with your cold sore?",
    "answer": {
        "text": "Stress"
    }
}
dropdown_with_multiselect:
Questions with option to select multiple answers. Answer(s) cannot contain nested question.
FieldTypeDescription
question_typestringRequired. Must be "dropdown_with_multiselect".
textstringRequired. Question text.
answermulti-dimentional arrayRequired. Contains array of answers. Answer cannot contain any "sub-question"
"multiple_option" example:
{
    "question_type": "dropdown_with_multiselect",
    "text": "Certain situations can trigger a cold sore outbreak. Which ones have you noticed? Select all that apply to you.",
    "answer": [
        {
            "text": "Stress"
        },
        {
            "text": "Fever"
        }
    ]
}
description:
Question having description (text) as answer, in general it is free text that is inserted by user. Answer cannot contain any subquestion.
FieldTypeDescription
question_typestringRequired. Must be "description".
textstringRequired. Question text.
answerarrayRequired. Contains only "text" element inside
"description" example:
{
    "question_type": "description",
    "text": "Please specify side effect and which medicine",
    "answer": {
        "text": "Itching, burning with PCM"
    }
}
table:
Contains multi-dimentional data, i.e. inserted by patient in a table form.
FieldTypeDescription
question_typestringRequired. Must be "table".
textstringRequired. Title of the table.
answerarrayRequired. Must contain array of "columns" and multi-dimentional "data" (as table data) related to that columns. "data" must contain all columns (specified in "columns" element) as key for related value.
"table" example:
{
    "question_type": "table",
    "text": "Vaccination History",
    "answer": {
        "columns": [
            "Vaccine Name",
            "Is Vaccinated",
            "Taken Date"
        ],
        "data": [
            {
                "Vaccine Name": "Flu",
                "Is Vaccinated": "No",
                "Taken Date": null
            },
            {
                "Vaccine Name": "Shingles",
                "Is Vaccinated": "Yes",
                "Taken Date": "2020-03-21"
            },
            {
                "Vaccine Name": "Pneumonia",
                "Is Vaccinated": "No",
                "Taken Date": null
            },
            {
                "Vaccine Name": "Tetanus",
                "Is Vaccinated": "Yes",
                "Taken Date": "2020-03-01"
            }
        ]
    }
}
text:
Question having text as answer, in general it is long text. Answer cannot contain any subquestion.
FieldTypeDescription
question_typestringRequired. Must be "text".
textstringRequired. Question text.
answerarrayRequired. Contains only "text" element inside
"text" example:
{
    "question_type": "text",
    "text": "When you have a cold sore outbreak and you don't take medicine, where are your cold sores located?",
    "answer": {
        "text": "On the lips or the edge / border of the lips"
    }
}
numbers_only:
Question having number as answer. Answer cannot contain any subquestion.
FieldTypeDescription
question_typestringRequired. Must be "numbers_only".
textstringRequired. Question text.
answerarrayRequired. Contains only "text" element inside, should be a number.
"numbers_only" example:
{
    "question_type": "numbers_only",
    "text": "If you don’t take medicine, how many times a year do you get cold sore outbreak?",
    "answer": {
        "text": 5
    }
}
date:
Question having date as answer. Answer cannot contain any subquestion.
FieldTypeDescription
question_typestringRequired. Must be "date".
textstringRequired. Question text.
answerarrayRequired. Contains only "text" element inside, must be a date in "YYYY-MM-DD" format.
"date" example:
{
    "question_type": "date",
    "text": "Please specify your date of birth?",
    "answer": {
        "text": "1987-01-22"
    }
}
file:
Files to be attached with form response. File(s) will be uploaded separately using "Upload patient file" API. Here, we will attach response of that API to map uploaded files with patient form response.
FieldTypeDescription
question_typestringRequired. Must be "file".
textstringRequired. Question text.
attachmentsmulti-dimentional arrayRequired. Contains elements with keys "file_name" and "uuid", that are returned from "Upload patient file" API.
"file" example:
{
    "question_type": "file",
    "text": "Please upload your prescription",
    "attachments": [
        {
            "file_name": "prescription1.jpg",
            "uuid": "4405a28c-c4d7-44f1-9546-e59b02f02643"
        },
        {
            "file_name": "prescription2.png",
            "uuid": "b7141288-17db-49b6-ba86-262d99e8b685"
        },
        {
            "file_name": "prescription3.pdf",
            "uuid": "6fd0b2f3-2b0c-4822-9156-ea12803334f6"
        }
    ]
}
Example Success Response:
Status: 200
{
    "message": "Data posted successfully"
}
Example Failure Response:
Status: 400 or 403 or 500
{
    "error_message": "Request Failed. {{error_message}}"
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params

Body Params text/plain
Example
Example:{ "patient_id": {{patient_id}}, "patient_form_name": {{patient_form_name}}, "form_responses": [ { "question_type": "single_option", "text": "Have you seen us before?", "answer": { "text": "This is my first consult for depression or anxiety", "subquestion": { "question_type": "single_option", "text": "Have you ever used prescription medicines to help treat cold sores? If yes, which one and what dose? Select all that apply to you.", "answer": { "text": "I have not taken any prescription medicine for cold sores", "subquestion": { "question_type": "description", "text": "Please tell us more", "answer": { "text": "I have not taken any prescription medicine for cold sores" } } } } } }, { "question_type": "single_option", "text": "Have you ever used prescription medicines to help treat cold sores? If yes, which one and what dose? Select all that apply to you.", "answer": { "text": "Yes", "subquestion": { "question_type": "date", "text": "Please specify the date you've used it", "answer": { "text": "2021-01-20" } } } }, { "question_type": "multiple_option", "text": "What is the reason you are using doctodoor today?", "answer": [ { "text": "Want prescription medicine to take as needed when a cold sore outbreak happens (PRN)", "subquestion": { "question_type": "single_option", "text": "When you have a cold sore outbreak and you don't take medicine, where are your cold sores located? Select all that apply to you.", "answer": { "text": "On the lips or the edge / border of the lips" } } }, { "text": "Other", "subquestion": { "question_type": "description", "text": "Please tell us more.", "answer": { "text": "Some other text inserted by user" } } } ] }, { "question_type": "dropdown", "text": "If you don’t take medicine, do you develop blisters with your cold sore?", "answer": { "text": "Stress" } }, { "question_type": "dropdown_with_multiselect", "text": "Certain situations can trigger a cold sore outbreak. Which ones have you noticed? Select all that apply to you.", "answer": [ { "text": "Stress" }, { "text": "Fever" } ] }, { "question_type": "description", "text": "Please specify side effect and which medicine", "answer": { "text": "Itching, burning with PCM" } }, { "question_type": "table", "text": "Vaccination History", "answer": { "columns": [ "Vaccine Name", "Is Vaccinated", "Taken Date" ], "data": [ { "Vaccine Name": "Flu", "Is Vaccinated": "No", "Taken Date": null }, { "Vaccine Name": "Shingles", "Is Vaccinated": "Yes", "Taken Date": "2020-03-21" }, { "Vaccine Name": "Pneumonia", "Is Vaccinated": "No", "Taken Date": null }, { "Vaccine Name": "Tetanus", "Is Vaccinated": "Yes", "Taken Date": "2020-03-01" } ] } }, { "question_type": "text", "text": "When you have a cold sore outbreak and you don't take medicine, where are your cold sores located?", "answer": { "text": "On the lips or the edge / border of the lips" } }, { "question_type": "numbers_only", "text": "If you don’t take medicine, how many times a year do you get cold sore outbreak?", "answer": { "text": 5 } }, { "question_type": "date", "text": "Please specify your date of birth?", "answer": { "text": "1987-01-22" } }, { "question_type": "file", "text": "Please upload your prescription", "attachments": [ { "file_name": "prescription1.jpg", "uuid": "4405a28c-c4d7-44f1-9546-e59b02f02643" }, { "file_name": "prescription2.png", "uuid": "b7141288-17db-49b6-ba86-262d99e8b685" }, { "file_name": "prescription3.pdf", "uuid": "6fd0b2f3-2b0c-4822-9156-ea12803334f6" } ] } ] }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/service/v1/patient/form' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
	"patient_id": {{patient_id}},
	"patient_form_name": {{patient_form_name}},
	"form_responses": [
		{
			"question_type": "single_option",
			"text": "Have you seen us before?",
			"answer": {
				"text": "This is my first consult for depression or anxiety",
				"subquestion": {
					"question_type": "single_option",
					"text": "Have you ever used prescription medicines to help treat cold sores? If yes, which one and what dose? Select all that apply to you.",
					"answer": {
						"text": "I have not taken any prescription medicine for cold sores",
						"subquestion": {
							"question_type": "description",
							"text": "Please tell us more",
							"answer": {
								"text": "I have not taken any prescription medicine for cold sores"
							}
						}
					}
				}
			}
		},
		{
			"question_type": "single_option",
			"text": "Have you ever used prescription medicines to help treat cold sores? If yes, which one and what dose? Select all that apply to you.",
			"answer": {
				"text": "Yes",
				"subquestion": {
					"question_type": "date",
					"text": "Please specify the date you'\''ve used it",
					"answer": {
						"text": "2021-01-20"
					}
				}
			}
		},
		{
			"question_type": "multiple_option",
			"text": "What is the reason you are using doctodoor today?",
			"answer": [
				{
					"text": "Want prescription medicine to take as needed when a cold sore outbreak happens (PRN)",
					"subquestion": {
						"question_type": "single_option",
						"text": "When you have a cold sore outbreak and you don'\''t take medicine, where are your cold sores located? Select all that apply to you.",
						"answer": {
							"text": "On the lips or the edge / border of the lips"
						}
					}
				},
				{
					"text": "Other",
					"subquestion": {
						"question_type": "description",
						"text": "Please tell us more.",
						"answer": {
							"text": "Some other text inserted by user"
						}
					}
				}
			]
		},
		{
			"question_type": "dropdown",
			"text": "If you don’t take medicine, do you develop blisters with your cold sore?",
			"answer": {
				"text": "Stress"
			}
		},
		{
			"question_type": "dropdown_with_multiselect",
			"text": "Certain situations can trigger a cold sore outbreak. Which ones have you noticed? Select all that apply to you.",
			"answer": [
				{
					"text": "Stress"
				},
				{
					"text": "Fever"
				}
			]
		},
		{
			"question_type": "description",
			"text": "Please specify side effect and which medicine",
			"answer": {
				"text": "Itching, burning with PCM"
			}
		},
		{
			"question_type": "table",
			"text": "Vaccination History",
			"answer": {
				"columns": [
					"Vaccine Name",
					"Is Vaccinated",
					"Taken Date"
				],
				"data": [
					{
						"Vaccine Name": "Flu",
						"Is Vaccinated": "No",
						"Taken Date": null
					},
					{
						"Vaccine Name": "Shingles",
						"Is Vaccinated": "Yes",
						"Taken Date": "2020-03-21"
					},
					{
						"Vaccine Name": "Pneumonia",
						"Is Vaccinated": "No",
						"Taken Date": null
					},
					{
						"Vaccine Name": "Tetanus",
						"Is Vaccinated": "Yes",
						"Taken Date": "2020-03-01"
					}
				]
			}
		},
		{
			"question_type": "text",
			"text": "When you have a cold sore outbreak and you don'\''t take medicine, where are your cold sores located?",
			"answer": {
				"text": "On the lips or the edge / border of the lips"
			}
		},
		{
			"question_type": "numbers_only",
			"text": "If you don’t take medicine, how many times a year do you get cold sore outbreak?",
			"answer": {
				"text": 5
			}
		},
		{
			"question_type": "date",
			"text": "Please specify your date of birth?",
			"answer": {
				"text": "1987-01-22"
			}
		},
		{
			"question_type": "file",
			"text": "Please upload your prescription",
			"attachments": [
                {
                    "file_name": "prescription1.jpg",
                    "uuid": "4405a28c-c4d7-44f1-9546-e59b02f02643"
                },
                {
                    "file_name": "prescription2.png",
                    "uuid": "b7141288-17db-49b6-ba86-262d99e8b685"
                },
                {
                    "file_name": "prescription3.pdf",
                    "uuid": "6fd0b2f3-2b0c-4822-9156-ea12803334f6"
                }
            ]
		}
	]
}'

Responses

🟢200Submit Patient's Form Response
application/json
Body

Example
{
    "message": "Data posted successfully"
}
Modified at 2024-10-16 08:59:22
Previous
Upload Patient File
Next
Lab readings
Built with