Examples
Common usage patterns for atl-server HTTP API.
Anchor a payload
curl -X POST "$ATL_BASE_URL/v1/anchor" \
-H 'Content-Type: application/json' \
-d '{
"payload": { "hello": "world" },
"metadata": { "filename": "example.json" },
"external_id": "client-123"
}'Response is an immediate receipt (often super_proof: null, anchors: []) with upgrade_url.
Fetch current receipt
curl "$ATL_BASE_URL/v1/anchor/550e8400-e29b-41d4-a716-446655440000"Replace UUID with your entry ID from the anchor response.
With access tokens
If ATL_ACCESS_TOKENS is enabled:
curl -X POST "$ATL_BASE_URL/v1/anchor" \
-H 'Authorization: Bearer your-token-here' \
-H 'Content-Type: application/json' \
-d '{"payload":{"hello":"world"}}'Verify receipt
Use atl-core to verify the returned receipt:
use atl_core::prelude::*;
fn verify(receipt_json: &str) -> AtlResult<()> {
let receipt = Receipt::from_json(receipt_json)?;
let result = ReceiptVerifier::anchor_only().verify(&receipt);
if result.is_valid && result.has_valid_anchor() {
println!("Receipt verified via anchors");
}
Ok(())
}Last updated on