hosted/ifttt/api/index.html

30 lines
No EOL
18 KiB
HTML

<!DOCTYPE html><html lang="en" class="dark"> <head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#0b1020"><link rel="canonical" href="http://localhost:4321/api/"><title>IF.Trace — API</title><meta name="description" content="API documentation for IF.Trace."><meta property="og:title" content="IF.Trace — API"><meta property="og:description" content="API documentation for IF.Trace."><meta property="og:type" content="website"><meta property="og:image" content="/assets/iftrace-og.svg"><meta name="twitter:card" content="summary_large_image"><link rel="icon" href="/assets/if-logo-simple.svg" type="image/svg+xml"><link rel="stylesheet" href="/assets/_astro/index.Dr9NnB1c.css"></head> <body class="min-h-screen bg-background text-foreground"> <div aria-hidden="true" class="pointer-events-none fixed inset-0 -z-10"> <div class="absolute inset-0 bg-[radial-gradient(900px_circle_at_20%_0%,rgba(59,130,246,0.10),transparent_60%),radial-gradient(900px_circle_at_100%_0%,rgba(16,185,129,0.08),transparent_55%)]"></div> <div class="absolute inset-0 bg-[linear-gradient(to_bottom,rgba(2,6,23,0.86),rgba(2,6,23,0.96))]"></div> <div class="absolute inset-0 opacity-[0.035] mix-blend-overlay [background-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22300%22%20height=%22300%22%3E%3Cfilter%20id=%22n%22%3E%3CfeTurbulence%20type=%22fractalNoise%22%20baseFrequency=%220.8%22%20numOctaves=%224%22%20stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect%20width=%22300%22%20height=%22300%22%20filter=%22url(%23n)%22%20opacity=%220.5%22/%3E%3C/svg%3E')]"></div> </div> <header class="fixed left-0 right-0 top-0 z-50"> <div class="mx-auto max-w-6xl px-4 py-4 sm:px-6"> <div class="flex items-center justify-between rounded-2xl border border-white/10 bg-slate-950/35 px-4 py-3 backdrop-blur-sm shadow-[0_10px_30px_rgba(0,0,0,0.25)] sm:px-6"> <a href="/" class="text-sm font-semibold tracking-tight text-white/90 hover:text-white">IF.Trace</a> <nav class="flex items-center gap-3 text-xs text-white/70 sm:gap-4"> <a class="hover:text-white" href="/verticals/">Use cases</a> <span class="text-white/20" aria-hidden="true">|</span> <a class="hover:text-white" href="/pricing/">Pricing</a> <span class="text-white/20" aria-hidden="true">|</span> <a class="hover:text-white" href="/api/">API</a> <span class="text-white/20" aria-hidden="true">|</span> <a class="hover:text-white" href="/whitepaper/">Whitepaper</a> </nav> <a class="hidden rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs font-medium text-white/80 hover:bg-white/10 hover:text-white sm:inline-flex" href="https://api.infrafabric.io/login">Login</a> </div> </div> </header> <main class="pt-28 sm:pt-32"> <div class="mx-auto w-full max-w-6xl px-4 sm:px-6 "> <section class="py-14 sm:py-16"> <div class="mx-auto max-w-3xl"> <p class="text-xs font-medium uppercase tracking-[0.18em] text-white/55">API</p> <h1 class="mt-4 text-4xl font-semibold tracking-tight text-white/95 sm:text-5xl">API</h1> <p class="mt-4 text-lg leading-relaxed text-white/75">Implementation ABC. Copy/paste examples. A real endpoint once the service is live.</p> </div> </section> <section class="py-8"> <div class="mb-6"> <h2 class="text-lg font-semibold tracking-tight text-white/95 sm:text-xl">Hello world</h2> <p class="mt-2 text-sm leading-relaxed text-white/70 sm:text-[0.95rem]">Create one receipt (source hash + output hash). Copy/paste.</p> <div class="mt-4 h-px w-full bg-white/10" aria-hidden="true"></div> </div> <div class="grid gap-4 lg:grid-cols-2"> <div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="text-xs font-medium uppercase tracking-wide text-white/50">curl</div> <pre class="mt-3 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85"> <code>curl -sS -X POST https://api.infrafabric.io/v1/trace \
-H &#39;Authorization: Bearer $IFTRACE_API_KEY&#39; \
-H &#39;Content-Type: application/json&#39; \
-d &#39;{&quot;source_sha256&quot;:&quot;...&quot;,&quot;output_sha256&quot;:&quot;...&quot;}&#39;</code>
</pre> <p class="mt-3 text-sm text-white/70">Use non-confidential test hashes. This endpoint is wired once the service is live.</p> </div> <div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="text-xs font-medium uppercase tracking-wide text-white/50">Response (example)</div> <pre class="mt-3 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85"> <code>{
&quot;shareId&quot;: &quot;6qRgcR01kw_qNo63Dbs_ob9n&quot;,
&quot;receipt_url&quot;: &quot;https://infrafabric.io/static/trace/6qRgcR01kw_qNo63Dbs_ob9n&quot;
}</code>
</pre> </div> </div> </section> <section class="py-8"> <div class="mb-6"> <h2 class="text-lg font-semibold tracking-tight text-white/95 sm:text-xl">Base URL</h2> <div class="mt-4 h-px w-full bg-white/10" aria-hidden="true"></div> </div> <div class="break-all rounded-xl border border-white/10 bg-slate-950/30 px-4 py-3 font-mono text-xs text-white/80">https://api.infrafabric.io</div> </section> <section class="py-8"> <div class="mb-6"> <h2 class="text-lg font-semibold tracking-tight text-white/95 sm:text-xl">Endpoints</h2> <p class="mt-2 text-sm leading-relaxed text-white/70 sm:text-[0.95rem]">Minimal surface area. Predictable responses.</p> <div class="mt-4 h-px w-full bg-white/10" aria-hidden="true"></div> </div> <div class="grid gap-4"> <div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between"> <div class="flex items-center gap-3"> <span class="rounded-full border border-white/10 bg-slate-950/30 px-3 py-1 text-xs font-semibold text-white/80">POST</span> <span class="break-all font-mono text-xs text-white/80">/v1/trace</span> </div> <div class="text-sm text-white/70">Create a receipt</div> </div> <div class="mt-4 overflow-x-auto"> <table class="w-full min-w-[720px] border-collapse text-left text-sm"> <thead class="text-xs uppercase tracking-wide text-white/50"> <tr> <th class="border-b border-white/10 py-2 pr-4">Field</th> <th class="border-b border-white/10 py-2 pr-4">Type</th> <th class="border-b border-white/10 py-2 pr-4">Required</th> <th class="border-b border-white/10 py-2 pr-4">Example</th> </tr> </thead> <tbody class="text-white/75"> <tr> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">source_sha256</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">hex</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">yes</td> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">84730eea481d385d77ec2ee6fc3416c7156c4ff6e2cccaae6fbed649511138ed</td> </tr><tr> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">output_sha256</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">hex</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">yes</td> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">c306c5964c2945727d9b6840678db6013c49275acb89d2dfc09b9ce1b4808cc3</td> </tr><tr> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">metadata</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">object</td> <td class="border-b border-white/10 py-2 pr-4 text-xs">no</td> <td class="border-b border-white/10 py-2 pr-4 font-mono text-xs">{&quot;kind&quot;:&quot;report-summary&quot;,&quot;public_title&quot;:&quot;Q4 review pack&quot;}</td> </tr> </tbody> </table> </div><div class="mt-4"> <div class="text-xs font-medium uppercase tracking-wide text-white/50">Response example</div> <pre class="mt-2 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85">
<code>{
&quot;shareId&quot;: &quot;6qRgcR01kw_qNo63Dbs_ob9n&quot;,
&quot;receipt_url&quot;: &quot;https://infrafabric.io/static/trace/6qRgcR01kw_qNo63Dbs_ob9n&quot;
}</code>
</pre> </div> </div><div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between"> <div class="flex items-center gap-3"> <span class="rounded-full border border-white/10 bg-slate-950/30 px-3 py-1 text-xs font-semibold text-white/80">GET</span> <span class="break-all font-mono text-xs text-white/80">/v1/trace/{shareId}</span> </div> <div class="text-sm text-white/70">Fetch receipt data</div> </div> </div> </div> </section> <section class="py-8"> <div class="mb-6"> <h2 class="text-lg font-semibold tracking-tight text-white/95 sm:text-xl">Code</h2> <p class="mt-2 text-sm leading-relaxed text-white/70 sm:text-[0.95rem]">Copy/paste.</p> <div class="mt-4 h-px w-full bg-white/10" aria-hidden="true"></div> </div> <div class="grid gap-4 lg:grid-cols-2"> <div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="text-xs font-medium uppercase tracking-wide text-white/50">curl</div> <pre class="mt-3 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85"> <code>curl -sS -X POST https://api.infrafabric.io/v1/trace \
-H &#39;Authorization: Bearer $IFTRACE_API_KEY&#39; \
-H &#39;Content-Type: application/json&#39; \
-d &#39;{&quot;source_sha256&quot;:&quot;...&quot;,&quot;output_sha256&quot;:&quot;...&quot;}&#39;</code>
</pre> </div><div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)] "> <div class="text-xs font-medium uppercase tracking-wide text-white/50">Node</div> <pre class="mt-3 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85"> <code>const res = await fetch(&#39;https://api.infrafabric.io/v1/trace&#39;, {
method: &#39;POST&#39;,
headers: {
Authorization: `Bearer ${process.env.IFTRACE_API_KEY}`,
&#39;Content-Type&#39;: &#39;application/json&#39;
},
body: JSON.stringify({ source_sha256: &#39;...&#39;, output_sha256: &#39;...&#39; })
});</code>
</pre> </div> </div> </section> <section class="py-8"> <div class="mb-6"> <h2 class="text-lg font-semibold tracking-tight text-white/95 sm:text-xl">Test</h2> <p class="mt-2 text-sm leading-relaxed text-white/70 sm:text-[0.95rem]">Send a request. See the real response.</p> <div class="mt-4 h-px w-full bg-white/10" aria-hidden="true"></div> </div> <style>astro-island,astro-slot,astro-static-slot{display:contents}</style><script>(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event("astro:load"));})();</script><script>(()=>{var A=Object.defineProperty;var g=(i,o,a)=>o in i?A(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var d=(i,o,a)=>g(i,typeof o!="symbol"?o+"":o,a);{let i={0:t=>m(t),1:t=>a(t),2:t=>new RegExp(t),3:t=>new Date(t),4:t=>new Map(a(t)),5:t=>new Set(a(t)),6:t=>BigInt(t),7:t=>new URL(t),8:t=>new Uint8Array(t),9:t=>new Uint16Array(t),10:t=>new Uint32Array(t),11:t=>1/0*t},o=t=>{let[l,e]=t;return l in i?i[l](e):void 0},a=t=>t.map(o),m=t=>typeof t!="object"||t===null?t:Object.fromEntries(Object.entries(t).map(([l,e])=>[l,o(e)]));class y extends HTMLElement{constructor(){super(...arguments);d(this,"Component");d(this,"hydrator");d(this,"hydrate",async()=>{var b;if(!this.hydrator||!this.isConnected)return;let e=(b=this.parentElement)==null?void 0:b.closest("astro-island[ssr]");if(e){e.addEventListener("astro:hydrate",this.hydrate,{once:!0});return}let c=this.querySelectorAll("astro-slot"),n={},h=this.querySelectorAll("template[data-astro-template]");for(let r of h){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("data-astro-template")||"default"]=r.innerHTML,r.remove())}for(let r of c){let s=r.closest(this.tagName);s!=null&&s.isSameNode(this)&&(n[r.getAttribute("name")||"default"]=r.innerHTML)}let p;try{p=this.hasAttribute("props")?m(JSON.parse(this.getAttribute("props"))):{}}catch(r){let s=this.getAttribute("component-url")||"<unknown>",v=this.getAttribute("component-export");throw v&&(s+=` (export ${v})`),console.error(`[hydrate] Error parsing props for component ${s}`,this.getAttribute("props"),r),r}let u;await this.hydrator(this)(this.Component,p,n,{client:this.getAttribute("client")}),this.removeAttribute("ssr"),this.dispatchEvent(new CustomEvent("astro:hydrate"))});d(this,"unmount",()=>{this.isConnected||this.dispatchEvent(new CustomEvent("astro:unmount"))})}disconnectedCallback(){document.removeEventListener("astro:after-swap",this.unmount),document.addEventListener("astro:after-swap",this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute("await-children")||document.readyState==="interactive"||document.readyState==="complete")this.childrenConnectedCallback();else{let e=()=>{document.removeEventListener("DOMContentLoaded",e),c.disconnect(),this.childrenConnectedCallback()},c=new MutationObserver(()=>{var n;((n=this.lastChild)==null?void 0:n.nodeType)===Node.COMMENT_NODE&&this.lastChild.nodeValue==="astro:end"&&(this.lastChild.remove(),e())});c.observe(this,{childList:!0}),document.addEventListener("DOMContentLoaded",e)}}async childrenConnectedCallback(){let e=this.getAttribute("before-hydration-url");e&&await import(e),this.start()}async start(){let e=JSON.parse(this.getAttribute("opts")),c=this.getAttribute("client");if(Astro[c]===void 0){window.addEventListener(`astro:${c}`,()=>this.start(),{once:!0});return}try{await Astro[c](async()=>{let n=this.getAttribute("renderer-url"),[h,{default:p}]=await Promise.all([import(this.getAttribute("component-url")),n?import(n):()=>()=>{}]),u=this.getAttribute("component-export")||"default";if(!u.includes("."))this.Component=h[u];else{this.Component=h;for(let f of u.split("."))this.Component=this.Component[f]}return this.hydrator=p,this.hydrate},e,this)}catch(n){console.error(`[astro-island] Error hydrating ${this.getAttribute("component-url")}`,n)}}attributeChangedCallback(){this.hydrate()}}d(y,"observedAttributes",["props"]),customElements.get("astro-island")||customElements.define("astro-island",y)}})();</script><astro-island uid="ZiSHI" prefix="r1" component-url="/assets/_astro/ApiTryForm.CSrrM9iB.js" component-export="ApiTryForm" renderer-url="/assets/_astro/client.nc8uITnr.js" props="{&quot;baseUrl&quot;:[0,&quot;https://api.infrafabric.io&quot;]}" ssr client="load" opts="{&quot;name&quot;:&quot;ApiTryForm&quot;,&quot;value&quot;:true}" await-children><div class="rounded-2xl border border-white/10 bg-white/5 p-5 shadow-[0_16px_60px_rgba(0,0,0,0.35)]"><div class="text-sm font-semibold text-white/90">Try the endpoint</div><p class="mt-2 text-sm text-white/70">This sends a real request to <span class="font-medium text-white/85">https://api.infrafabric.io</span>. Use non-confidential hashes.</p><div class="mt-4 grid gap-3 sm:grid-cols-2"><label class="grid gap-1 text-xs text-white/70">API key (optional)<input placeholder="IFTRACE_API_KEY" class="rounded-xl border border-white/10 bg-slate-950/30 px-3 py-2 text-sm text-white/90 placeholder:text-white/35" value=""/></label><div class="hidden sm:block"></div><label class="grid gap-1 text-xs text-white/70">source_sha256<input placeholder="64-hex" class="rounded-xl border border-white/10 bg-slate-950/30 px-3 py-2 text-sm text-white/90 placeholder:text-white/35" value=""/></label><label class="grid gap-1 text-xs text-white/70">output_sha256<input placeholder="64-hex" class="rounded-xl border border-white/10 bg-slate-950/30 px-3 py-2 text-sm text-white/90 placeholder:text-white/35" value=""/></label><label class="grid gap-1 text-xs text-white/70 sm:col-span-2">metadata (JSON, optional)<textarea rows="3" class="rounded-xl border border-white/10 bg-slate-950/30 px-3 py-2 font-mono text-xs text-white/90 placeholder:text-white/35">{&quot;kind&quot;:&quot;report-summary&quot;,&quot;public_title&quot;:&quot;Q4 review pack&quot;}</textarea></label></div><div class="mt-4 flex flex-col gap-2 sm:flex-row sm:items-center"><button type="button" class="inline-flex items-center justify-center rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-60">Send request</button><button type="button" class="inline-flex items-center justify-center rounded-full border border-white/12 bg-white/5 px-4 py-2 text-sm font-medium text-white/85 transition hover:bg-white/10 hover:text-white">Copy curl</button></div><div class="mt-4"><div class="text-xs font-medium uppercase tracking-wide text-white/50">curl</div><pre class="mt-2 overflow-x-auto rounded-2xl border border-white/10 bg-slate-950/40 p-4 text-xs text-white/85"><code>curl -sS -X POST https://api.infrafabric.io/v1/trace \
-H &#x27;Authorization: Bearer $IFTRACE_API_KEY&#x27; \
-H &#x27;Content-Type: application/json&#x27; \
-d &#x27;{&quot;source_sha256&quot;:&quot;&quot;,&quot;output_sha256&quot;:&quot;&quot;,&quot;metadata&quot;:{&quot;kind&quot;:&quot;report-summary&quot;,&quot;public_title&quot;:&quot;Q4 review pack&quot;}}&#x27;</code></pre></div></div><!--astro:end--></astro-island> </section> <footer class="pb-16 pt-6"> <div class="flex flex-col gap-3 border-t border-white/10 pt-8 text-sm text-white/70 sm:flex-row sm:items-center sm:justify-between"> <div>Integrity, not interpretation.</div> <div class="flex flex-wrap gap-4"> <a href="/privacy/" class="hover:text-white"> Privacy </a><a href="/terms/" class="hover:text-white"> Terms </a><a href="mailto:ds@infrafabric.io?subject=IF.Trace%20contact" class="hover:text-white" target="_blank" rel="noreferrer"> Contact </a> </div> </div> </footer> </div> </main> <a href="mailto:ds@infrafabric.io?subject=IF.Trace%20contact" class="fixed bottom-6 right-6 inline-flex h-10 items-center justify-center rounded-full border border-white/10 bg-slate-950/50 px-4 text-xs font-medium text-white/80 backdrop-blur hover:bg-slate-950/70 hover:text-white">contact</a> </body></html>