API

API

Implementation ABC. Copy/paste examples. A real endpoint once the service is live.

Base URL

https://api.infrafabric.io

Endpoints

Minimal surface area. Predictable responses.

POST /v1/trace
Create a receipt
Field Type Required Example
source_sha256 hex yes 84730eea481d385d77ec2ee6fc3416c7156c4ff6e2cccaae6fbed649511138ed
output_sha256 hex yes c306c5964c2945727d9b6840678db6013c49275acb89d2dfc09b9ce1b4808cc3
metadata object no {"kind":"report-summary","public_title":"Q4 review pack"}
Response example

                  {
  "shareId": "6qRgcR01kw_qNo63Dbs_ob9n",
  "receipt_url": "https://infrafabric.io/static/trace/6qRgcR01kw_qNo63Dbs_ob9n"
}
                
GET /v1/trace/{shareId}
Fetch receipt data

Code

Copy/paste.

curl
              curl -sS -X POST https://api.infrafabric.io/v1/trace \
  -H 'Authorization: Bearer $IFTRACE_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"source_sha256":"...","output_sha256":"..."}'
            
Node
              const res = await fetch('https://api.infrafabric.io/v1/trace', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.IFTRACE_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ source_sha256: '...', output_sha256: '...' })
});
            

Test

Send a request. See the real response.

Try the endpoint

This sends a real request to https://api.infrafabric.io. Use non-confidential hashes.

curl
curl -sS -X POST https://api.infrafabric.io/v1/trace \
  -H 'Authorization: Bearer $IFTRACE_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"source_sha256":"","output_sha256":"","metadata":{"kind":"report-summary","public_title":"Q4 review pack"}}'
contact