Skip to content

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.

FileKindSize
SKILL.mdskill md19.8 KB
references/apple.mdmarkdown3.5 KB
references/connect-insert.mdmarkdown5.4 KB
references/facebook.mdmarkdown9.0 KB
references/line.mdmarkdown3.3 KB
references/sms.mdmarkdown6.9 KB
references/whatsapp.mdmarkdown8.7 KB
references/worked-examples.mdmarkdown4.1 KB

references/line.md

View on GitHub
# LINE — token verify, request body, gotchas

`MESSAGE_TYPE=Line`. Platform key is the **LINE channel id** (numeric, from the LINE Developers
Console — not the LINE user id). Channel secret + access token go in `authDetails`.

## Inputs

- `{LINE_CHANNEL_ID}` — LINE channel id. Numeric string. Sent as `messagingPlatformKey`.
- `{LINE_CHANNEL_SECRET}` — LINE channel secret (webhook verification secret). Sent in
  `authDetails.client_secret`.
- `{LINE_ACCESS_TOKEN}` — LINE long-lived channel access token. Sent in `authDetails.access_token`.
- `{CHANNEL_NAME}` — optional. Defaults to `LINE_{LINE_CHANNEL_ID}` if not provided.
- `{VERIFY_TOKEN_FIRST}` — optional boolean, default `true`. When `true`, validate the token against
  LINE's public API before insert.

## Stage 2-3: optional token preflight

If `{VERIFY_TOKEN_FIRST}` is `true`, validate the token before paying the full insert cost. This is
a **third-party** call to LINE, so it uses `curl` (not `sf api request rest`) — the LINE token is
not a Salesforce credential:

```bash
curl -sS -o "${SCRATCH_DIR}/line-token.json" -w '\n%{http_code}' \
  -H "Authorization: Bearer ${LINE_ACCESS_TOKEN}" \
  "https://api.line.me/v2/bot/info"
```

- HTTP 200 → token valid, proceed.
- HTTP 401 / non-200 → `{ok:false, kind:"line-token-invalid", hint:"LINE access token rejected — regenerate in LINE Developers Console and retry"}`.

If `VERIFY_TOKEN_FIRST=false`, skip — the Connect POST will surface a token error later, with less
clear signal.

(`${SCRATCH_DIR}` is the per-run scratch dir established in SKILL.md Stage 0.2 — under
`${outputDir}`/`${TMPDIR}`, never a bare `/tmp` path.)

## Stage 4.2: request body

```json
{"messageType":"Line","platformType":"Enhanced",
 "messagingPlatformKey":"{LINE_CHANNEL_ID}",
 "messagingChannelName":"{CHANNEL_NAME}",
 "authDetails":{"client_secret":"{LINE_CHANNEL_SECRET}","access_token":"{LINE_ACCESS_TOKEN}"}}
```

**Write the body to a file** — the access token is long and can contain shell-hostile characters.

Response classification: same as the shared table (see `connect-insert.md`), plus — on `400` whose
message contains "access token" / "channel secret" / "Line" — emit
`{ok:false, kind:"line-token-invalid", message, hint:"LINE creds rejected — verify channel secret + access token in LINE Developers Console"}`.

## Gotchas

1. **`messagingPlatformKey` is the LINE channel id**, not the LINE user id — the numeric id shown in
   the Developers Console for the Messaging API channel.
2. **`authDetails` keys are exactly `client_secret` + `access_token`.** Don't rename them;
   `LiveMessageSetupServiceImpl.addChannel` looks for exactly those strings.
3. **Long-lived vs short-lived tokens.** The Setup wizard assumes long-lived (Developers Console).
   Short-lived tokens (Channel Access Token v2.1 API) insert fine but expire, silently stopping the
   channel. Use long-lived for production.
4. **No third-party registration at activation.** Unlike WhatsApp, LINE has no `/register` call —
   `service-de-channel-activate` transitions MCU→Active without any external callout, so
   `Provisioning` is essentially invisible (~1s).
5. **`sf api request rest` manages the SF OAuth session** — no `ACCESS_TOKEN`/`INSTANCE_URL` shell
   variables. The LINE token is the only credential handled by `curl`, and only for the Stage 2-3
   verify.
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall