Create a new screening fact for your brand
curl --request POST \
--url https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"note": "<string>",
"options": [
{
"code": "<string>",
"exclusive": true
}
]
}
'import requests
url = "https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts"
payload = {
"slug": "<string>",
"note": "<string>",
"options": [
{
"code": "<string>",
"exclusive": 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({
slug: '<string>',
note: '<string>',
options: [{code: '<string>', exclusive: true}]
})
};
fetch('https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts', 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.dev.purplelabelmd.com/v1/account/question-library/minted-facts",
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([
'slug' => '<string>',
'note' => '<string>',
'options' => [
[
'code' => '<string>',
'exclusive' => 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://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\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://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts")
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 \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"value": {
"cardinality": "single",
"code": "<string>",
"mode": "collected",
"phi_class": "none",
"value_type": "<string>",
"options": [
{
"code": "<string>",
"exclusive": true
}
]
}
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}Offering configuration
Create a new screening fact for your brand
Creates a genuinely-new screening fact in your brand’s own namespace, so answers can be reused across the flow without colliding with the shared facts or another brand’s. Screening facts are never medical information; a multiple-choice fact must define its option codes.
POST
/
v1
/
account
/
question-library
/
minted-facts
Create a new screening fact for your brand
curl --request POST \
--url https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"note": "<string>",
"options": [
{
"code": "<string>",
"exclusive": true
}
]
}
'import requests
url = "https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts"
payload = {
"slug": "<string>",
"note": "<string>",
"options": [
{
"code": "<string>",
"exclusive": 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({
slug: '<string>',
note: '<string>',
options: [{code: '<string>', exclusive: true}]
})
};
fetch('https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts', 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.dev.purplelabelmd.com/v1/account/question-library/minted-facts",
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([
'slug' => '<string>',
'note' => '<string>',
'options' => [
[
'code' => '<string>',
'exclusive' => 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://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\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://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.purplelabelmd.com/v1/account/question-library/minted-facts")
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 \"slug\": \"<string>\",\n \"note\": \"<string>\",\n \"options\": [\n {\n \"code\": \"<string>\",\n \"exclusive\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"value": {
"cardinality": "single",
"code": "<string>",
"mode": "collected",
"phi_class": "none",
"value_type": "<string>",
"options": [
{
"code": "<string>",
"exclusive": true
}
]
}
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"where": "<string>"
}
]
}Authorizations
Per-client API key (M2M). Presented as Authorization: Bearer <key>.
Body
application/json
mint a new brand-namespaced screening fact (phi_class 'none' is STRUCTURAL — not a field)
Available options:
single, multi a human slug namespaced into the brand code space (q_<brand>_<slug>)
Available options:
boolean, integer, decimal, string, date, coded, coded_set, measurement required for a multiple-choice fact — the stable option codes
Show child attributes
Show child attributes
Response
the minted fact
a minted screening fact — brand-namespaced code, phi_class 'none' by construction
Show child attributes
Show child attributes