Create and lookup requests with matching IDs, response bodies and failure cases
HTML for this example
Select the code and use your copy shortcut. Changes in this preview are temporary.
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; form-action 'none'; base-uri 'none'"><title>Parcel Desk v1 · create then retrieve</title><style>*{box-sizing:border-box}body{margin:0;font:16px/1.5 Arial,Helvetica,sans-serif;color:#24313b;background:#fff}main{max-width:900px;margin:auto;padding:22px}h1{font-size:26px;line-height:1.2;margin:8px 0 18px}h2{font-size:19px;margin:22px 0 10px}h3{font-size:17px;margin:14px 0 8px}p{margin:10px 0}ul,ol{padding-left:22px}li{margin:6px 0}.note{font-size:13px;color:#53616a}.callout{border-left:4px solid #405d73;background:#f2f5f7;padding:10px 14px}table{border-collapse:collapse;width:100%;margin:12px 0}caption{text-align:left;font-weight:bold;padding:0 0 8px}th,td{padding:9px 8px;text-align:left;vertical-align:top;border-bottom:1px solid #b8c3ca;overflow-wrap:anywhere}th{background:#edf2f5}td b{display:none}footer{border-top:1px solid #aeb9bf;margin-top:22px;padding-top:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:16px/1.5 ui-monospace,monospace;background:#f5f5f5;padding:12px}@media(max-width:560px){main{padding:16px}h1{font-size:23px}thead{display:none}table,tbody,tr,td{display:block;width:100%}caption{display:block}tr{border-bottom:1px solid #aeb9bf;padding:6px 0}td{border:0;padding:3px 0}td b{display:inline}}@media print{@page{size:letter;margin:.5in}main{padding:0}}.operation{border-top:3px solid #40556d;padding-top:10px;margin-top:24px}.unknown{background:#fff6e9;padding:12px}code{overflow-wrap:anywhere}.status{font-weight:bold}</style></head><body><main><p class="note">Original fictional API contract · no backend or live requests</p><h1>Parcel Desk v1 · create then retrieve</h1><p>Base: <code>https://api.example.invalid/v1</code> · Authentication: illustrative <code>Authorization: Bearer YOUR_TOKEN</code>. Token issuance/expiry:[TO CONFIRM].</p><section class="operation" data-operation="create"><h2>POST /shipments</h2><table><caption>Create fields · fictional contract</caption><thead><tr><th scope="col">Field</th><th scope="col">Requirement</th><th scope="col">Allowed value</th></tr></thead><tbody><tr><td><b>Field: </b>destination</td><td><b>Requirement: </b>Required string</td><td><b>Allowed value: </b>Nonempty delivery address</td></tr><tr><td><b>Field: </b>service_level</td><td><b>Requirement: </b>Required string</td><td><b>Allowed value: </b>standard or express</td></tr></tbody></table><h3>Review command · do not execute placeholder URL</h3><pre>curl -X POST https://api.example.invalid/v1/shipments \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"destination":"120 Example Lane","service_level":"standard"}'</pre><h3>Request body</h3><pre data-json="create-request">{"destination":"120 Example Lane","service_level":"standard"}</pre><h3>201 · created</h3><pre data-json="create-success">{"shipment_id":"shp_demo_001","status":"queued"}</pre><h3>400 · unsupported service_level</h3><p>Supplying <code>service_level: overnight</code> produces this illustrative validation response:</p><pre data-json="create-error">{"error":{"code":"invalid_service_level","field":"service_level","message":"Use standard or express."}}</pre></section><section class="operation" data-operation="lookup"><h2>GET /shipments/shp_demo_001</h2><p>Use the shipment_id returned by create. Required path value:shipment_id. No body.</p><pre>curl https://api.example.invalid/v1/shipments/shp_demo_001 \
-H 'Authorization: Bearer YOUR_TOKEN'</pre><h3>200 · found</h3><pre data-json="lookup-success">{"shipment_id":"shp_demo_001","status":"queued"}</pre><h3>404 · ID not found</h3><pre data-json="lookup-error">{"error":{"code":"shipment_not_found","message":"No shipment exists for the supplied ID."}}</pre></section><section class="unknown"><h2>Confirm before implementation</h2><p>Rate limits, retry rules, idempotency, token expiry and actual deployment/versioning policy:[TO CONFIRM]. Do not infer retry safety from the displayed create command.</p></section><footer>Selectable code only; no copy button or request runner. Keep the repository contract authoritative. No live integration or request success verified.</footer></main></body></html>