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

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

---

## Links (HTML-first)

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

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

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

Source bundle (tgz):
https://infrafabric.io/static/source/89c87775cd166a6eb0cc550fb9e557285808bf27a56172540eb9ec7868c6853b.tgz

---

## What this proves (black/white)

This demo proves:
- a known IFTTT 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 IFTTT API calls, OAuth scopes, or applet execution
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    89c87775cd166a6eb0cc550fb9e557285808bf27a56172540eb9ec7868c6853b

Input JSON sha256:

    226fd3f036df684fc747eec8fa74bf42f54ffb293cc3438ea6b160ed1e979e9c

Normalized output JSON sha256:

    95cc1a3be86eafed5099c77f3acab69daf66d16794d0440ac7784367df23510f

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-ifttt-demo-source.tgz "https://infrafabric.io/static/source/89c87775cd166a6eb0cc550fb9e557285808bf27a56172540eb9ec7868c6853b.tgz"
sha256sum if-api-ifttt-demo-source.tgz

tar -xzf if-api-ifttt-demo-source.tgz
python3 resolve_ifttt_demo.py ifttt_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    89c87775cd166a6eb0cc550fb9e557285808bf27a56172540eb9ec7868c6853b  if-api-ifttt-demo-source.tgz

Expected `sha256sum` (normalized output):

    95cc1a3be86eafed5099c77f3acab69daf66d16794d0440ac7784367df23510f  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "226fd3f036df684fc747eec8fa74bf42f54ffb293cc3438ea6b160ed1e979e9c",
  "integration": "ifttt",
  "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": [
    {
      "applet_id": "a1b2c3d4",
      "metadata": {
        "action": "email.send",
        "owner": "demo.builder@example.com",
        "status": "enabled",
        "trigger": "google.drive.new_file"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://ifttt.com/applets/a1b2c3d4"
    },
    {
      "applet_id": "e5f6g7h8",
      "metadata": {
        "action": "google.sheets.append_row",
        "owner": "demo.builder@example.com",
        "status": "disabled",
        "trigger": "github.issue_opened"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://ifttt.com/applets/e5f6g7h8"
    }
  ],
  "schema_version": "demo.v1"
}
```
