meta api fix

This commit is contained in:
debu-2 2026-10-03 14:35:23 +05:30
parent 6810f392cc
commit e98036cd31
5 changed files with 33 additions and 50 deletions

View file

@ -66,7 +66,7 @@ https://urmiai.com/reports/{report_group}/{report_id}
**Console → Agent → UrmiAI**
Subscribe to **`agent_run_completion`** (display name: *Agent Run Success*).
Subscribe to **`agent_run_completion`** (Meta template: `agent_run_completion_v2`, display name: *Agent Run Success*).
Messages are sent from the Urmi AI WhatsApp Business number on your behalf.
@ -220,30 +220,25 @@ Authorization: Bearer urmi_live_<your_api_key>
| `customer_name` | Yes | string | Name inserted into the template body greeting |
| `report_group` | Yes | string | Urmiport report group slug (same as in publish API) |
| `report_id` | No | string | Report postfix. If omitted, Urmi auto-generates one (e.g. `run-a1b2c3`) |
| `report_url` | No | string | Full hosted report URL override. Auto-built as `https://urmiai.com/reports/{report_group}/{report_id}` when omitted |
### Template details — `agent_run_completion`
### Template details — `agent_run_completion` → Meta `agent_run_completion_v2`
| Property | Value |
|----------|-------|
| **Slug** | `agent_run_completion` |
| **Meta template name** | `agent_run_completion` |
| **Header** | Agent Run Complete |
| **API slug** | `agent_run_completion` |
| **Meta template name** | `agent_run_completion_v2` |
| **Header** | Agent Run Successful |
| **Body** | Hello {{customer_name}}, your agent run is complete… |
| **Button** | View Report → `https://urmiai.com/reports/{{1}}` |
| Component | Meta format | API field | Example |
|-----------|-------------|-----------|---------|
| Body | **Named** `customer_name` | `customer_name` | `Team Desi Clans` |
| Button URL | Positional `{{1}}` suffix | `report_group`/`report_id` | `desi-clans-test/2026-10-03` |
| Button URL | Positional `{{1}}` suffix | `report_group` + `report_id` | `desi-clans-test/2026-10-03` |
Urmi sends the button suffix so the final link should be:
Urmi builds the button suffix as `{report_group}/{report_id}` from the API request — **not** from any posted URL. The response includes `report_url` for convenience only.
`https://urmiai.com/reports/desi-clans-test/2026-10-03`
> **400 Invalid parameter:** Body must use named `parameter_name: "customer_name"` — positional body params fail on this template.
>
> **Broken button URL:** If the approved Meta template button URL contains a literal `{{1}}` prefix (e.g. `https://urmiai.com/reports/{{1}}{{1}}`), fix it in WhatsApp Manager → Message templates → edit button URL to `https://urmiai.com/reports/{{1}}` only.
Final link: `https://urmiai.com/reports/desi-clans-test/2026-10-03`
### Example
@ -256,8 +251,7 @@ curl -X POST 'https://urmiai.com/api/v1/agent/messages/send' \
"to": "919149154337",
"customer_name": "Suyash",
"report_group": "desi-clans-test",
"report_id": "2026-10-03",
"report_url": "https://urmiai.com/reports/desi-clans-test/2026-10-03"
"report_id": "2026-10-03"
}'
```