Get Network Query Status
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/network/query/{requestId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}', 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.sandbox.metriport.com/medical/v1/network/query/{requestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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://api.sandbox.metriport.com/medical/v1/network/query/{requestId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://api.sandbox.metriport.com/medical/v1/network/query/{requestId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const status = await metriport.getNetworkQueryStatus({
requestId: "22222222-2222-2222-2222-222222222222",
});
Network
Get Network Query Status
Returns the status of a specific network query request.
Listen to this pageabout 1 min
GET
/
medical
/
v1
/
network
/
query
/
{requestId}
Get Network Query Status
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/network/query/{requestId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}', 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.sandbox.metriport.com/medical/v1/network/query/{requestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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://api.sandbox.metriport.com/medical/v1/network/query/{requestId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://api.sandbox.metriport.com/medical/v1/network/query/{requestId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/network/query/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const status = await metriport.getNetworkQueryStatus({
requestId: "22222222-2222-2222-2222-222222222222",
});
Returns the status of a specific network query request - use this to check the progress of the query.
See more on Start Network Query.
Example Response Body (all sources started):
Example Response Body (with source errors):
To get notified about network query progress and completions, check
out Network Query Events.
Path Params
The ID of the network query request. This is returned when you start a network query.
Response
The unique identifier for this network query request. Use
this to track the query status and correlate webhooks.
The overall status of the network query. Can be one of:
processing- at least one source is still being queriedcompleted- all sources have completed successfullypartial- some sources completed, some failedfailed- all sources failed
Array of status objects for each data source being
queried. A source type may appear multiple times if it was
retried after a failure.
Array of errors for data sources that could not be
queried. Only present when one or more sources fail to
start.
Show SourceError properties
Show SourceError properties
The HTTP status code representing the error. Common
values: -
400 - Bad Request (access to this data
source is not enabled for this account) - 429 - Too
Many Requests (rate limit exceeded for this data
source){
"requestId": "00000000-0000-0000-0000-000000000000",
"startedAt": "2024-12-30T10:00:00.000Z",
"status": "processing",
"sources": [
{
"type": "hie",
"status": "processing",
"startedAt": "2024-12-30T10:00:00.500Z"
},
{
"type": "pharmacy",
"status": "processing",
"startedAt": "2024-12-30T10:00:00.750Z"
},
{
"type": "lab",
"status": "processing",
"startedAt": "2024-12-30T10:00:01.000Z"
}
]
}
{
"requestId": "00000000-0000-0000-0000-000000000000",
"startedAt": "2024-12-30T10:00:00.000Z",
"status": "processing",
"sources": [
{
"type": "hie",
"status": "processing",
"startedAt": "2024-12-30T10:00:00.500Z"
}
],
"errors": [
{
"source": "pharmacy",
"httpStatus": 400,
"message": "Access to pharmacy data source is not enabled for this account",
"timestamp": "2024-12-30T10:00:00.600Z"
},
{
"source": "lab",
"httpStatus": 429,
"message": "Rate limit exceeded for laboratory data source",
"timestamp": "2024-12-30T10:00:00.800Z"
}
]
}
import { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const status = await metriport.getNetworkQueryStatus({
requestId: "22222222-2222-2222-2222-222222222222",
});

