Skip to main content
Upload Lab Report
curl --request POST \
  --url https://app-api.spikeapi.com/v3/lab_reports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "body": "<string>",
  "filename": "<string>",
  "wait_on_process": true
}
'
import requests

url = "https://app-api.spikeapi.com/v3/lab_reports"

payload = {
    "body": "<string>",
    "filename": "<string>",
    "wait_on_process": True
}
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({body: JSON.stringify('<string>'), filename: '<string>', wait_on_process: true})
};

fetch('https://app-api.spikeapi.com/v3/lab_reports', 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://app-api.spikeapi.com/v3/lab_reports",
  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([
    'body' => '<string>',
    'filename' => '<string>',
    'wait_on_process' => true
  ]),
  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://app-api.spikeapi.com/v3/lab_reports"

	payload := strings.NewReader("{\n  \"body\": \"<string>\",\n  \"filename\": \"<string>\",\n  \"wait_on_process\": true\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://app-api.spikeapi.com/v3/lab_reports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"body\": \"<string>\",\n  \"filename\": \"<string>\",\n  \"wait_on_process\": true\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app-api.spikeapi.com/v3/lab_reports")

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  \"body\": \"<string>\",\n  \"filename\": \"<string>\",\n  \"wait_on_process\": true\n}"

response = http.request(request)
puts response.read_body
{
  "lab_report": {
    "record_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "collection_date": "<string>",
    "lab_information": {
      "address": "<string>",
      "email_address": "<string>",
      "name": "<string>",
      "notes": "<string>",
      "phone_number": "<string>"
    },
    "modified_at": "2023-11-07T05:31:56Z",
    "notes": "<string>",
    "original_record_id": "<string>",
    "parsing_error": "<string>",
    "patient_information": {
      "address": "<string>",
      "age": 1,
      "date_of_birth": "<string>",
      "email_address": "<string>",
      "gender": "<string>",
      "name": "<string>",
      "notes": "<string>",
      "patient_id": "<string>",
      "phone_number": "<string>"
    },
    "result_date": "<string>",
    "sections": [
      {
        "loinc_code": "<string>",
        "loinc_common_name": "<string>",
        "original_section_name": "<string>",
        "results": [
          {
            "original_test_name": "<string>",
            "original_unit_name": "<string>",
            "standard_test_name": "<string>",
            "standard_unit_name": "<string>",
            "loinc_code": "<string>",
            "loinc_common_name": "<string>",
            "normal_max": 123,
            "normal_min": 123,
            "notes": "<string>",
            "require_human_review": true,
            "tested_positive": true,
            "value": 123,
            "value_text": "<string>",
            "within_normal_range": true
          }
        ],
        "section_notes": "<string>",
        "standard_section_name": "<string>"
      }
    ],
    "uploaded_at": "2023-11-07T05:31:56Z"
  }
}
{
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}
{
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}
{
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}
{
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}
{
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

raw body

body
string
required

raw body in base64

filename
string
required

filename of the document

wait_on_process
boolean

wait for the process to complete

Response

OK

lab_report
object
required