Toingg Ops Toolkit
This skill bundles everything needed to manage Toingg campaigns from Claw:
- Campaign creation via
create_campaign.py
- Campaign discovery via
fetch_campaigns.py when you need to list active IDs for users
- On-demand calls via
make_call.py (after collecting name, phone, and campaign)
- Optional analytics cron (7 PM daily) powered by
get_campaign_analytics.py
- Contact upload + WhatsApp broadcast using
xlsx_to_contacts.py, add_contacts.py, and send_whatsapp_templates.py
All HTTP calls reuse the TOINGG_API_TOKEN bearer token.
Setup
- Export your token in every environment that runs these scripts (gateway, cron, terminals).
export TOINGG_API_TOKEN="tg_..."
- Install Python deps once if you will ingest Excel files:
pip install openpyxl requests
- Keep payloads (campaign JSON, analytics snapshots, contact exports) in version control or shared storage per your security rules.
Campaign discovery workflow
Use this whenever the user wants to see active campaigns or needs a campaign ID before launching a call.
- Ask whether they already know the campaign ID. If not, offer to fetch the latest list (default pagination is fine unless they request a different page size).
- Run:
./scripts/fetch_campaigns.py --skip 0 --limit 10 --sort -1 > responses/campaigns-$(date +%s).json
Adjust --skip/--limit/--sort if the user needs deeper pages or a different ordering.
- Summarize the response back to the user: surface at least
campID, name, status, and any relevant dates so they can choose confidently.
- Store the JSON output when ongoing work depends on the snapshot.
On-demand call workflow
When the user asks you to place a call, gather three pieces of information before touching the API:
- Caller name (string shown in Toingg logs).
- Phone number in international format.
- Campaign selection. If they do not supply a campaign, ask whether they want the latest list. Use the campaign discovery workflow above to provide options, then confirm their pick.
Once those details are confirmed, trigger the API:
./scripts/make_call.py "Recipient Name" +919999999999 64fd3f9...
The helper always sends asr=AZURE, startMessage=true, clearMemory=false, and extraParams={} per the product team’s defaults. Echo the API response (success or failure) back to the user so they know the call status.
Campaign creation workflow
- Gather campaign fields from the user (title, voice, language, script, purpose, tone,
post-call schema, notification numbers, autopilot flags, etc.).
- Draft a payload JSON using
references/payload-template.md as the scaffold.
- Run the helper:
cd skills/toingg-create-campaign
./scripts/create_campaign.py payloads/my_campaign.json > responses/create-$(date +%s).json
- Return the API response (campaign ID, status, or validation errors) to the user and log it.
Opt-in analytics cron (7 PM daily)
Only offer this when the user explicitly asks for daily analytics.
- Confirm desired schedule/output directory.
- Follow
references/analytics-cron.md to create openclaw cron create toingg-analytics-digest ... with the provided command snippet. Adjust paths if needed.
- Double-check
TOINGG_API_TOKEN is visible to the gateway before enabling the cron.
- After the first run, share where the JSON snapshots live and how to disable the cron (
openclaw cron delete ...).
get_campaign_analytics.py can also be run ad-hoc for on-demand pulls:
./scripts/get_campaign_analytics.py > analytics.json
Contact upload + WhatsApp templates
When a user supplies an Excel sheet (name / phone / context columns) and wants to blast a WhatsApp template:
Convert Excel → JSON
./scripts/xlsx_to_contacts.py ~/Downloads/leads.xlsx contacts.json
See references/contact-workflow.md for the exact column expectations and troubleshooting. The script skips blank rows and normalizes phone numbers.
Upload contacts to a Toingg contact list (auto-creates if missing):
./scripts/add_contacts.py ClawTest contacts.json
Send WhatsApp templates once the list is ready:
./scripts/send_whatsapp_templates.py \
231565687 \
bfesfbgf \
en-US \
ClawTest \
--payload template-variables.json
- Omit
--payload (defaults to []) if the template has no variables.
- Pass
--resend only when the user explicitly wants to re-contact existing recipients.
Confirm delivery status in Toingg and report any errors back to the user (the helper prints full JSON responses for logging).
File map
| Script |
Purpose |
scripts/create_campaign.py |
POST /api/v3/create_campaign with arbitrary payloads |
scripts/fetch_campaigns.py |
GET /api/v3/get_campaigns for quick campaign listings |
scripts/make_call.py |
POST /api/v3/make_call once you have name/phone/campaign |
scripts/get_campaign_analytics.py |
GET /api/v3/get_campaign_analytics (cron-friendly) |
scripts/xlsx_to_contacts.py |
Convert Excel sheets into Toingg contact JSON |
scripts/add_contacts.py |
Upload contact lists via /api/v3/add_contacts |
scripts/send_whatsapp_templates.py |
Trigger /api/v3/send_whatsapp_templates |
Keep this toolkit lightweight: update the references when Toingg adds new fields or workflows so other operators can follow the same patterns.
1---
2name: toingg-create-campaign
3description: "End-to-end Toingg ops: create campaigns, (optionally) schedule
4 daily analytics pulls, and turn Excel contact sheets into WhatsApp outreach
5 via add_contacts + send_whatsapp_templates. Use when Codex needs to automate
6 Toingg voice/WhatsApp workflows and requires scripts for campaign POSTs,
7 analytics cron setup, or bulk contact uploads."
8metadata:
9 source: https://skillmd.com/skills/modbender/toingg-create-campaign
10---
11
12
13# Toingg Ops Toolkit
14
15This skill bundles everything needed to manage Toingg campaigns from Claw:
16
17- **Campaign creation** via `create_campaign.py`
18- **Campaign discovery** via `fetch_campaigns.py` when you need to list active IDs for users
19- **On-demand calls** via `make_call.py` (after collecting name, phone, and campaign)
20- **Optional analytics cron** (7 PM daily) powered by `get_campaign_analytics.py`
21- **Contact upload + WhatsApp broadcast** using `xlsx_to_contacts.py`, `add_contacts.py`, and `send_whatsapp_templates.py`
22
23All HTTP calls reuse the `TOINGG_API_TOKEN` bearer token.
24
25## Setup
26
271. Export your token in every environment that runs these scripts (gateway, cron, terminals).
28 ```bash
29 export TOINGG_API_TOKEN="tg_..."
30 ```
312. Install Python deps once if you will ingest Excel files:
32 ```bash
33 pip install openpyxl requests
34 ```
353. Keep payloads (campaign JSON, analytics snapshots, contact exports) in version control or shared storage per your security rules.
36
37## Campaign discovery workflow
38
39Use this whenever the user wants to see active campaigns or needs a campaign ID before launching a call.
40
411. Ask whether they already know the campaign ID. If not, offer to fetch the latest list (default pagination is fine unless they request a different page size).
422. Run:
43 ```bash
44 ./scripts/fetch_campaigns.py --skip 0 --limit 10 --sort -1 > responses/campaigns-$(date +%s).json
45 ```
46 Adjust `--skip/--limit/--sort` if the user needs deeper pages or a different ordering.
473. Summarize the response back to the user: surface at least `campID`, `name`, status, and any relevant dates so they can choose confidently.
484. Store the JSON output when ongoing work depends on the snapshot.
49
50## On-demand call workflow
51
52When the user asks you to place a call, gather *three* pieces of information before touching the API:
53
541. **Caller name** (string shown in Toingg logs).
552. **Phone number** in international format.
563. **Campaign selection.** If they do not supply a campaign, ask whether they want the latest list. Use the campaign discovery workflow above to provide options, then confirm their pick.
57
58Once those details are confirmed, trigger the API:
59
60```bash
61./scripts/make_call.py "Recipient Name" +919999999999 64fd3f9...
62```
63
64The helper always sends `asr=AZURE`, `startMessage=true`, `clearMemory=false`, and `extraParams={}` per the product team’s defaults. Echo the API response (success or failure) back to the user so they know the call status.
65
66## Campaign creation workflow
67
681. Gather campaign fields from the user (title, voice, language, script, purpose, tone,
69 post-call schema, notification numbers, autopilot flags, etc.).
702. Draft a payload JSON using [`references/payload-template.md`](references/payload-template.md) as the scaffold.
713. Run the helper:
72 ```bash
73 cd skills/toingg-create-campaign
74 ./scripts/create_campaign.py payloads/my_campaign.json > responses/create-$(date +%s).json
75 ```
764. Return the API response (campaign ID, status, or validation errors) to the user and log it.
77
78## Opt-in analytics cron (7 PM daily)
79
80Only offer this when the user explicitly asks for daily analytics.
81
821. Confirm desired schedule/output directory.
832. Follow [`references/analytics-cron.md`](references/analytics-cron.md) to create `openclaw cron create toingg-analytics-digest ...` with the provided command snippet. Adjust paths if needed.
843. Double-check `TOINGG_API_TOKEN` is visible to the gateway before enabling the cron.
854. After the first run, share where the JSON snapshots live and how to disable the cron (`openclaw cron delete ...`).
86
87`get_campaign_analytics.py` can also be run ad-hoc for on-demand pulls:
88```bash
89./scripts/get_campaign_analytics.py > analytics.json
90```
91
92## Contact upload + WhatsApp templates
93
94When a user supplies an Excel sheet (name / phone / context columns) and wants to blast a WhatsApp template:
95
961. **Convert Excel → JSON**
97 ```bash
98 ./scripts/xlsx_to_contacts.py ~/Downloads/leads.xlsx contacts.json
99 ```
100 See [`references/contact-workflow.md`](references/contact-workflow.md) for the exact column expectations and troubleshooting. The script skips blank rows and normalizes phone numbers.
101
1022. **Upload contacts** to a Toingg contact list (auto-creates if missing):
103 ```bash
104 ./scripts/add_contacts.py ClawTest contacts.json
105 ```
106
1073. **Send WhatsApp templates** once the list is ready:
108 ```bash
109 ./scripts/send_whatsapp_templates.py \
110 231565687 \
111 bfesfbgf \
112 en-US \
113 ClawTest \
114 --payload template-variables.json
115 ```
116 - Omit `--payload` (defaults to `[]`) if the template has no variables.
117 - Pass `--resend` only when the user explicitly wants to re-contact existing recipients.
118
1194. Confirm delivery status in Toingg and report any errors back to the user (the helper prints full JSON responses for logging).
120
121## File map
122
123| Script | Purpose |
124|--------|---------|
125| `scripts/create_campaign.py` | POST `/api/v3/create_campaign` with arbitrary payloads |
126| `scripts/fetch_campaigns.py` | GET `/api/v3/get_campaigns` for quick campaign listings |
127| `scripts/make_call.py` | POST `/api/v3/make_call` once you have name/phone/campaign |
128| `scripts/get_campaign_analytics.py` | GET `/api/v3/get_campaign_analytics` (cron-friendly) |
129| `scripts/xlsx_to_contacts.py` | Convert Excel sheets into Toingg contact JSON |
130| `scripts/add_contacts.py` | Upload contact lists via `/api/v3/add_contacts` |
131| `scripts/send_whatsapp_templates.py` | Trigger `/api/v3/send_whatsapp_templates` |
132
133Keep this toolkit lightweight: update the references when Toingg adds new fields or workflows so other operators can follow the same patterns.