Get patient reports
curl --request GET \
--url https://v2.flabs.in/client/patient/getReports \
--header 'Authorization: Bearer <token>' \
--header 'patient-authorization: <api-key>'import requests
url = "https://v2.flabs.in/client/patient/getReports"
headers = {
"Authorization": "Bearer <token>",
"patient-authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'patient-authorization': '<api-key>'}
};
fetch('https://v2.flabs.in/client/patient/getReports', 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/patient/getReports",
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>",
"patient-authorization: <api-key>"
],
]);
$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://v2.flabs.in/client/patient/getReports"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("patient-authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://v2.flabs.in/client/patient/getReports")
.header("Authorization", "Bearer <token>")
.header("patient-authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.flabs.in/client/patient/getReports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["patient-authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"reportUrl": "report-url",
"reportDate": "2023-10-01T12:00:00Z",
"labName": "Lab Name",
"patientName": "John Doe",
"tests": [
"Test 1",
"Test 2"
],
"_id": "unique-id"
}
]{
"success": false,
"status": 401,
"message": "Unauthorized",
"error": {
"details": "Invalid patient token"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Patient Reports
Get Patient Reports
Retrieves all reports for a patient registered through the client lab.
GET
/
client
/
patient
/
getReports
Get patient reports
curl --request GET \
--url https://v2.flabs.in/client/patient/getReports \
--header 'Authorization: Bearer <token>' \
--header 'patient-authorization: <api-key>'import requests
url = "https://v2.flabs.in/client/patient/getReports"
headers = {
"Authorization": "Bearer <token>",
"patient-authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'patient-authorization': '<api-key>'}
};
fetch('https://v2.flabs.in/client/patient/getReports', 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/patient/getReports",
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>",
"patient-authorization: <api-key>"
],
]);
$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://v2.flabs.in/client/patient/getReports"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("patient-authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://v2.flabs.in/client/patient/getReports")
.header("Authorization", "Bearer <token>")
.header("patient-authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.flabs.in/client/patient/getReports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["patient-authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"reportUrl": "report-url",
"reportDate": "2023-10-01T12:00:00Z",
"labName": "Lab Name",
"patientName": "John Doe",
"tests": [
"Test 1",
"Test 2"
],
"_id": "unique-id"
}
]{
"success": false,
"status": 401,
"message": "Unauthorized",
"error": {
"details": "Invalid patient token"
}
}{
"success": false,
"status": 500,
"message": "Internal Server Error",
"error": {
"details": "An unexpected error occurred"
}
}Authorizations
Authorization token obtained from the auth API
Patient token in format: Bearer {patientToken}
Query Parameters
Flabs lab (branch) identifier. Fetch the list of labs via GET /client/labs.
Response
Successful response
Was this page helpful?
⌘I