cURL
curl --request POST \
--url https://app.spotdx.com/api/v3/kits/{public_id}/activate/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"sex": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"research_consent": true
}
'import requests
url = "https://app.spotdx.com/api/v3/kits/{public_id}/activate/"
payload = {
"patient_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"sex": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"research_consent": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
patient_id: '<string>',
first_name: '<string>',
last_name: '<string>',
date_of_birth: '2023-12-25',
sex: '<string>',
street1: '<string>',
street2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
research_consent: true
})
};
fetch('https://app.spotdx.com/api/v3/kits/{public_id}/activate/', 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.spotdx.com/api/v3/kits/{public_id}/activate/",
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([
'patient_id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'date_of_birth' => '2023-12-25',
'sex' => '<string>',
'street1' => '<string>',
'street2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'research_consent' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.spotdx.com/api/v3/kits/{public_id}/activate/"
payload := strings.NewReader("{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.spotdx.com/api/v3/kits/{public_id}/activate/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.spotdx.com/api/v3/kits/{public_id}/activate/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"result": "success"
}
}{
"error": {
"status": 400,
"type": "bad_request",
"detail": "The first_name field is required"
}
}{
"error": {
"status": 403,
"type": "forbidden",
"detail": "At-home testing is not available to residents of New York state"
}
}{
"error": {
"status": 404,
"type": "forbidden",
"detail": "Kit id SPOTZZZZZZ not found"
}
}Activate Kit
Activate a kit via API by either providing ‘patient_id’ or the information needed to create a new patient. Please note that the activation API is only available for selected kits.
POST
/
api
/
v3
/
kits
/
{public_id}
/
activate
/
cURL
curl --request POST \
--url https://app.spotdx.com/api/v3/kits/{public_id}/activate/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"sex": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"research_consent": true
}
'import requests
url = "https://app.spotdx.com/api/v3/kits/{public_id}/activate/"
payload = {
"patient_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-12-25",
"sex": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"research_consent": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
patient_id: '<string>',
first_name: '<string>',
last_name: '<string>',
date_of_birth: '2023-12-25',
sex: '<string>',
street1: '<string>',
street2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
research_consent: true
})
};
fetch('https://app.spotdx.com/api/v3/kits/{public_id}/activate/', 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.spotdx.com/api/v3/kits/{public_id}/activate/",
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([
'patient_id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'date_of_birth' => '2023-12-25',
'sex' => '<string>',
'street1' => '<string>',
'street2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'research_consent' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.spotdx.com/api/v3/kits/{public_id}/activate/"
payload := strings.NewReader("{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.spotdx.com/api/v3/kits/{public_id}/activate/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.spotdx.com/api/v3/kits/{public_id}/activate/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"patient_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"date_of_birth\": \"2023-12-25\",\n \"sex\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"research_consent\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"result": "success"
}
}{
"error": {
"status": 400,
"type": "bad_request",
"detail": "The first_name field is required"
}
}{
"error": {
"status": 403,
"type": "forbidden",
"detail": "At-home testing is not available to residents of New York state"
}
}{
"error": {
"status": 404,
"type": "forbidden",
"detail": "Kit id SPOTZZZZZZ not found"
}
}Authorizations
Body
application/json
Provide 'patient_id' to activate the kit for an existing patient, or provide patient details to create a new patient. Individual field requirements depend on the kit type being activated. Please note that the activation API is only available for selected kits.