# if.api demo — Zapier automation resolver (receipt-backed)

**Audience:** external reviewers + operators  
**Reality gate:** demo of a transformation contract, not a deployed Zapier integration.

---

## Links (HTML-first)

if.trace receipt:
https://infrafabric.io/static/trace/Jj_tBbpBkdm97tcdxwGv6Q

Pack (HTML view):
https://infrafabric.io/static/pack/Jj_tBbpBkdm97tcdxwGv6Q

Pack (raw Markdown):
https://infrafabric.io/static/pack/Jj_tBbpBkdm97tcdxwGv6Q.md

Source bundle (tgz):
https://infrafabric.io/static/source/7f4a36cb172a2a14d686aec4103ef8bce06565896be6d5029879d661a59e6be7.tgz

---

## What this proves (black/white)

This demo proves:
- a known Zapier automation definition can be transformed deterministically into a normalized event envelope
- the output is bound to if.trace receipts (hash checks; signatures only where present and verifiable)

This demo does not prove:
- live Zapier API calls, OAuth scopes, or trigger execution
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    7f4a36cb172a2a14d686aec4103ef8bce06565896be6d5029879d661a59e6be7

Input JSON sha256:

    e04438d3e440b88b8d05725ebd44157be3528734d7ef675260be39b1b739be28

Normalized output JSON sha256:

    636829012b528f4777e0e15a8bb05964202e629093ea5bb38ba61bd77f35deb4

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-zapier-demo-source.tgz "https://infrafabric.io/static/source/7f4a36cb172a2a14d686aec4103ef8bce06565896be6d5029879d661a59e6be7.tgz"
sha256sum if-api-zapier-demo-source.tgz

tar -xzf if-api-zapier-demo-source.tgz
python3 resolve_zapier_demo.py zapier_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    7f4a36cb172a2a14d686aec4103ef8bce06565896be6d5029879d661a59e6be7  if-api-zapier-demo-source.tgz

Expected `sha256sum` (normalized output):

    636829012b528f4777e0e15a8bb05964202e629093ea5bb38ba61bd77f35deb4  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "e04438d3e440b88b8d05725ebd44157be3528734d7ef675260be39b1b739be28",
  "integration": "zapier",
  "notes": {
    "integrity": "see if.trace receipt for output bytes",
    "live_lookup": false
  },
  "requested_at": "2026-01-07T00:00:00Z",
  "resolved_at": "2026-01-07T00:00:00Z",
  "results": [
    {
      "metadata": {
        "action": "slack.post_message",
        "owner": "demo.builder@example.com",
        "status": "on",
        "trigger": "google.drive.new_file"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://zapier.com/app/zaps/441122",
      "zap_id": "441122"
    },
    {
      "metadata": {
        "action": "google.sheets.append_row",
        "owner": "demo.builder@example.com",
        "status": "paused",
        "trigger": "github.push"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://zapier.com/app/zaps/778899",
      "zap_id": "778899"
    }
  ],
  "schema_version": "demo.v1"
}
```
