Get Patient
curl --request GET \
--url https://api.soharhealth.com/v1/patients/{patientId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.soharhealth.com/v1/patients/{patientId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.soharhealth.com/v1/patients/{patientId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.soharhealth.com/v1/patients/{patientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.soharhealth.com/v1/patients/{patientId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.soharhealth.com/v1/patients/{patientId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/v1/patients/{patientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"patientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "09/20/2023",
"state": "CA",
"address": "1 BROADWAY, LOS ANGELES, CA 90210",
"created": "2024-01-01T12:00:00.000Z",
"updated": "2024-01-01T12:00:00.000Z"
}{
"error": "invalid_request_error"
}{
"error": "invalid_request_error"
}{
"error": "Too many requests"
}Legacy Endpoints
Get Patient
This API is still available but no longer supported and is planned for deprecation in a future release.
GET
/
v1
/
patients
/
{patientId}
Get Patient
curl --request GET \
--url https://api.soharhealth.com/v1/patients/{patientId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.soharhealth.com/v1/patients/{patientId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.soharhealth.com/v1/patients/{patientId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.soharhealth.com/v1/patients/{patientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.soharhealth.com/v1/patients/{patientId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.soharhealth.com/v1/patients/{patientId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/v1/patients/{patientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"patientId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "09/20/2023",
"state": "CA",
"address": "1 BROADWAY, LOS ANGELES, CA 90210",
"created": "2024-01-01T12:00:00.000Z",
"updated": "2024-01-01T12:00:00.000Z"
}{
"error": "invalid_request_error"
}{
"error": "invalid_request_error"
}{
"error": "Too many requests"
}Authorizations
Include an OAuth 2.0 bearer token in the Authorization header. See Authentication.
Response
A patient
The Sohar ID for the patient
Example:
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
The patient's first name
Example:
"John"
The patient's last name
Example:
"Doe"
The patient's birth date in MM/DD/YYYY format
Pattern:
^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d\d$Example:
"09/20/2023"
Two-letter US state code
Available options:
AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VA, VT, WA, WI, WV, WY Example:
"CA"
The patient's address
Example:
"1 BROADWAY, LOS ANGELES, CA 90210"
An ISO 8601 date and time string describing when the patient was created
Example:
"2024-01-01T12:00:00.000Z"
An ISO 8601 date and time string describing when the patient was last updated
Example:
"2024-01-01T12:00:00.000Z"