API Interactions
The CRE SDK provides an HTTP client that allows your workflows to interact with external APIs. Use it to fetch offchain data, send results to other systems, or trigger external events.
Guides
- Making GET Requests: Learn how to fetch data from a public API using a
GETrequest. - Making POST Requests: Learn how to send data to an external endpoint using a
POSTrequest. - Submitting Reports via HTTP: Learn how to submit cryptographically signed reports to an external HTTP endpoint.
- Verifying CRE Reports Offchain: Verify report signatures and read workflow metadata when receiving reports over HTTP or other offchain channels.
CRE reports over HTTP
A CRE report is a DON-signed package your workflow creates with runtime.report() (TypeScript) or runtime.GenerateReport() (Go). It contains your encoded payload, workflow metadata, and cryptographic signatures.
A typical secure integration uses two parties:
- Sender: a CRE workflow that runs your logic, signs a report, and POSTs it to a URL. See Submitting Reports via HTTP.
- Receiver: your API or another CRE workflow that verifies the report before using the data. See Verifying CRE Reports Offchain.
The sender creates the report inside the workflow; the receiver must verify signatures before trusting the payload.