Laboratory › Developers › Examples
Examples
Every example below runs against a real endpoint. None of them contains a credential, because there is no credential to contain.
List the laboratory's scientific positions
curl -s https://tiffany.systems/api/claims.json | jq '{count, note}'
Fetch an exact claim version
cURL
curl -s https://tiffany.systems/api/demo/claims/demo-0001/v2.json \
| jq '{version: .identity.version, digest: .identity.digest,
lifecycle: .record.lifecycle, qualification: .record.qualification,
replication: .record.epistemic.replication}'
JavaScript
const base = 'https://tiffany.systems';
async function claimVersion(slug, version) {
const res = await fetch(`${base}/api/demo/claims/${slug}/${version}.json`);
if (!res.ok) throw new Error(`${res.status} fetching ${slug} ${version}`); // body is not JSON
return res.json();
}
const v = await claimVersion('demo-0001', 'v2');
// Never reduce the status vector to a boolean. Report the dimensions.
console.log(v.record.lifecycle, v.record.qualification, v.record.epistemic.replication);
// Internal reproduction is NOT independent replication.
const independent = v.record.epistemic.replication.startsWith('INDEPENDENT');
console.log('independently replicated:', independent); // false
Python
import json, urllib.request
BASE = "https://tiffany.systems"
def get(path):
with urllib.request.urlopen(BASE + path) as r: # any non-200 raises; the body is not JSON
return json.load(r)
v = get("/api/demo/claims/demo-0001/v2.json")
print(v["record"]["lifecycle"], v["record"]["qualification"])
for row in v["coverage"]["rows"]:
print(row["id"], row["support"]) # DIRECT / ASSUMPTION_DEPENDENT / UNSUPPORTED / …
Detect that a claim was withdrawn
curl -s https://tiffany.systems/api/demo/claims/demo-0001.json \
| jq '{current: .current_version,
states: [.versions[] | {v: .record.version, lifecycle: .record.lifecycle}],
withdrawal: [.versions[] | select(.record.withdrawal) | .record.withdrawal.reason]}'
The identity document tells you the current state; each version tells you what it said at the time. Both matter: the first is what the laboratory asserts now, the second is what your citation points at.
Inspect evidence coverage
curl -s https://tiffany.systems/api/demo/claims/demo-0001/v3.json | jq '.coverage.sentence'
# "0 of 3 components are directly supported; 0 are supported with a stated qualification;
# 3 are unsupported, unmeasured or contradicted."
Prose, never a percentage. A client must not derive a score from it — that is exactly the compression this laboratory refuses to make.
Read the deterministic policy decisions
curl -s https://tiffany.systems/api/demo/claims/demo-0001/v2.json \
| jq '.policy.rules[] | select(.status=="FAIL") | {id, title, missing}'
Empty for a published record — a rule that blocks means the record was never published. Useful for understanding what a status was required to satisfy.
Ask a bounded question
curl -s https://tiffany.systems/api/demo/queries/lacking-independent-replication.json | jq '{question, results}'
Verify an artifact
curl -sO https://tiffany.systems/demo/artifacts/demo-a-run1.out
curl -sO https://tiffany.systems/demo/artifacts/demo-a-run2.out
shasum -a 256 demo-a-run1.out demo-a-run2.out
# both hash to the sha256 published for artifacts R2 and R3, and to each other
Verify the whole site at once
curl -s https://tiffany.systems/build-manifest.txt -o manifest.txt
curl -s https://tiffany.systems/api/claims.json -o claims.json
shasum -a 256 claims.json
grep '/api/claims.json' manifest.txt
Every file the build wrote appears in that manifest except the manifest itself, which cannot contain its own digest.
Resolve a status term instead of guessing
curl -s https://tiffany.systems/api/ontology.json \
| jq '.dimensions.replication.terms.INTERNAL_REPRODUCTION.definition'
Every term a response can contain is defined and versioned there. A client that pattern-matches strings will eventually mistake reproduction for replication, which is the single most consequential confusion on this site.
PreviousQuickstart
NextReference