forcedotcom/sf-skills / skills/service-de-channel-create
service-de-channel-create
Unverified**INTERNAL USE ONLY — invoked by `service-de-headless-channel-configure`.** Insert an Enhanced messaging `MessagingChannel` (plus child `MessagingChannelUsage` as a free side-effect) of any type — WhatsApp, LINE, Apple Business Chat, Facebook, or SMS. Given a `{MESSAGE_TYPE}` and its inputs, runs the shared preflight → Connect-insert → verify flow, branching only where a type differs. Uses `POST /services/data/v{V}/connect/livemessage/channels` — no Aura session, no shell-stored token. **Invoke `service-de-headless-channel-configure` instead** — it handles insert → route → activate in one flow; replaces the four former per-type creation skills.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.8 KB |
| references/apple.md | markdown | 3.5 KB |
| references/connect-insert.md | markdown | 5.4 KB |
| references/facebook.md | markdown | 9.0 KB |
| references/line.md | markdown | 3.3 KB |
| references/sms.md | markdown | 6.9 KB |
| references/whatsapp.md | markdown | 8.7 KB |
| references/worked-examples.md | markdown | 4.1 KB |
references/worked-examples.md
View on GitHub---
name: service-de-channel-create-worked-examples
description: "Load for end-to-end traces of a channel insert per type — a fresh Connect-path insert (Apple, verified on wadtesting), a preflight short-circuit re-run, and the Facebook interactive OAuth → page-selection path. Illustrative only; the authoritative flow is the parent SKILL.md stages."
metadata:
version: "1.0"
related-skills: service-de-channel-create
---
# Worked examples (per type)
## Apple Business Chat — fresh insert (real trace, wadtesting 2026-04-30)
`messagingcore-wadtesting2.test1.my.pc-rnd.salesforce.com`. Inputs:
`APPLE_BC_ID=c02e9350-f526-42dc-9e8d-cec2edf59487`, `CHANNEL_NAME=Apple Channel`.
- **Stage 1** — preflight SOQL (two-query FK form) returns 0 rows. Proceed.
- **Stage 4.1** — `SELECT Id FROM AuthProvider WHERE DeveloperName='LiveMessageSetup'` → one row,
captured as `{AUTH_PROVIDER_ID}` (org-specific).
- **Stage 4.2** — body `{"messageType":"AppleBusinessChat","platformType":"Enhanced","messagingPlatformKey":"c02e9350-...","messagingChannelName":"Apple Channel"}`;
POST to `.../connect/livemessage/channels?authProviderId=${AUTH_PROVIDER_ID}`. Response 201:
```json
{"id":"0MjSG000000MNUD0A4","developerName":"AppleBusinessChat_c02e9350_...",
"isActive":false,"masterLabel":"c02e9350-...","messageType":"AppleBusinessChat",
"messagingPlatformKey":"c02e9350-..."}
```
The `masterLabel`/`developerName` in the body are **stale input-rep projections** — the DB row uses
`MasterLabel="Apple Channel"` and the canonical `APPLEBUSINESSCHAT_US_c02e9350_...`.
- **Stage 5** — verify SOQL confirms `MasterLabel="Apple Channel"`,
`DeveloperName="APPLEBUSINESSCHAT_US_c02e9350_..."`, `IsActive=false`; MCU `0gLSG0000003Kjl2AE`,
`DeploymentType=Conversation`, `DeploymentStatus=New`.
- **Stage 6** — success envelope, `path:"connect"`, `created:true`.
Downstream chain ran immediately after: routing PATCH → 204; activation PATCH
(`DeploymentStatus="Provisioning"`) → 204 in ~1s (Apple hits the observer's `default` branch — no
external callout).
**Gotcha surfaced:** the first POST omitted `?authProviderId=` (based on an older skill version
claiming "Apple doesn't use authProviderId") → `400 ILLEGAL_QUERY_PARAMETER_VALUE`. Corrected:
`authProviderId` is universally required.
## LINE — fresh insert (illustrative)
Inputs: `LINE_CHANNEL_ID=2001234567`, secret + long-lived token, `CHANNEL_NAME=Support LINE Channel`.
- **Stage 1** preflight → 0 rows.
- **Stage 2-3** (optional token verify) → `GET https://api.line.me/v2/bot/info` returns 200. Valid.
- **Stage 4.2** body includes `authDetails:{client_secret, access_token}`. Response 201 →
`{id:"0MjSG000000Fd2m0AD", developerName:"LINE_2001234567", ...}`.
- **Stage 5** verify → channel + one MCU `DeploymentType=Conversation`. Success `path:"connect"`.
## Preflight short-circuit (any type)
Re-running an insert for a channel that already exists:
- **Stage 1** preflight SOQL finds `records.length === 1`. Records `{CHANNEL_ID}`, `{DEVELOPER_NAME}`,
`{IS_ACTIVE}`; second query picks up `{MCU_ID}`.
- Emits success envelope with `path:"preflight", created:false`. Stages 2-5 never run. This is the
idempotency guard (`MessagingChannel` rows aren't deletable via standard means).
## Facebook — interactive OAuth → page selection (illustrative)
`PAGE_ID` not supplied.
- **Stage 1** skipped (no page id yet).
- **Stage 2-3** — look up `{AUTH_PROVIDER_ID}`; the stored FB token is stale, so open the OAuth URL
in a browser, wait for the user to authorize, then fetch the page list. Render all pages sorted by
`masterLabel`, annotated with connected status, untruncated. User selects one → `{PAGE_ID}`. Prompt
for `{CHANNEL_NAME}`. Now run the Stage 1 preflight for the chosen page id.
- **Stage 4.2** body `{..., messagingPlatformKey:"{PAGE_ID}", authDetails:{}}`. If the response
errorCode is `AUTH_PROVIDER_NEEDS_AUTH` (may arrive as 400 OR 401), emit `oauth-not-complete` and
re-run OAuth — do NOT tell the user to run `sf org login web` (the SF session is fine).
- **Stage 5** verify → MCU `DeploymentStatus=New` (Facebook lands as `New`, not `Disabled`). Success.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |