Create Discovery V1
curl --request POST \
--url https://api.soharhealth.com/v1/discovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/2000",
"state": "CA",
"npi": "0123456789",
"zipCode": "90210",
"id": "123456"
}
'import requests
url = "https://api.soharhealth.com/v1/discovery"
payload = {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/2000",
"state": "CA",
"npi": "0123456789",
"zipCode": "90210",
"id": "123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '01/01/2000',
state: 'CA',
npi: '0123456789',
zipCode: '90210',
id: '123456'
})
};
fetch('https://api.soharhealth.com/v1/discovery', 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/discovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '01/01/2000',
'state' => 'CA',
'npi' => '0123456789',
'zipCode' => '90210',
'id' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.soharhealth.com/v1/discovery"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.soharhealth.com/v1/discovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/v1/discovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"discoveryId": "fb701ac1-1246-4860-b1ec-bd916b97a990",
"id": "123456"
}{
"error": "invalid_request_error",
"param": "firstName"
}{
"error": "invalid_request_error"
}{
"error": "Too many requests"
}Legacy Endpoints
Create Discovery V1
POST
/
v1
/
discovery
Create Discovery V1
curl --request POST \
--url https://api.soharhealth.com/v1/discovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/2000",
"state": "CA",
"npi": "0123456789",
"zipCode": "90210",
"id": "123456"
}
'import requests
url = "https://api.soharhealth.com/v1/discovery"
payload = {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/2000",
"state": "CA",
"npi": "0123456789",
"zipCode": "90210",
"id": "123456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '01/01/2000',
state: 'CA',
npi: '0123456789',
zipCode: '90210',
id: '123456'
})
};
fetch('https://api.soharhealth.com/v1/discovery', 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/discovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '01/01/2000',
'state' => 'CA',
'npi' => '0123456789',
'zipCode' => '90210',
'id' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.soharhealth.com/v1/discovery"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.soharhealth.com/v1/discovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.soharhealth.com/v1/discovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"01/01/2000\",\n \"state\": \"CA\",\n \"npi\": \"0123456789\",\n \"zipCode\": \"90210\",\n \"id\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"discoveryId": "fb701ac1-1246-4860-b1ec-bd916b97a990",
"id": "123456"
}{
"error": "invalid_request_error",
"param": "firstName"
}{
"error": "invalid_request_error"
}{
"error": "Too many requests"
}Authorizations
Include an OAuth 2.0 bearer token in the Authorization header. See Authentication.
Body
application/json
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"
A Type 1 or Type 2 NPI
Example:
"0123456789"
An optional parameter to improve patient matching confidence
Example:
"90210"
An optional parameter to prioritize the specified payer. See the Sohar payer list
Example:
"62308"
An optional user defined identifier for the discovery
Maximum string length:
255Example:
"123456"