List referral hospitals in a branch
curl --request GET \
--url https://v2.flabs.in/client/crm/hospitals \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.flabs.in/client/crm/hospitals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.flabs.in/client/crm/hospitals', 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://v2.flabs.in/client/crm/hospitals",
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;
}HttpResponse<String> response = Unirest.get("https://v2.flabs.in/client/crm/hospitals")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://v2.flabs.in/client/crm/hospitals");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"hospitals": [
{
"_id": "6530a4a6f1d2c8b7e9ahos01",
"name": "City Care Hospital"
},
{
"_id": "6530a4a6f1d2c8b7e9ahos02",
"name": "Sunrise Multispeciality"
}
]
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Referral partners
List Referral Hospitals
Returns the active referral hospitals of the given branch, with their _id and name, sorted by name. Hospitals the lab marked inactive, and temporary entries, are left out.
Use the _id:
- as
referredHospitalOrganizationon Create Lead or Booking, to record who referred the patient; - as
organizationon List Tests, List Packages and webhook calls, on a party-scoped account.
The list can be long (a few thousand hospitals for a large lab): fetch it once and search it on your side.
GET
/
client
/
crm
/
hospitals
List referral hospitals in a branch
curl --request GET \
--url https://v2.flabs.in/client/crm/hospitals \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.flabs.in/client/crm/hospitals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.flabs.in/client/crm/hospitals', 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://v2.flabs.in/client/crm/hospitals",
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;
}HttpResponse<String> response = Unirest.get("https://v2.flabs.in/client/crm/hospitals")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://v2.flabs.in/client/crm/hospitals");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"hospitals": [
{
"_id": "6530a4a6f1d2c8b7e9ahos01",
"name": "City Care Hospital"
},
{
"_id": "6530a4a6f1d2c8b7e9ahos02",
"name": "Sunrise Multispeciality"
}
]
}{
"success": false,
"status": 400,
"message": "Bad Request",
"error": {
"details": "first_name is required"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Was this page helpful?