CRADמפתחים
עברית

Campaigns from your business admin

Choose a permitted audience, review the exact message, confirm once and recover uncertain results. Your interface uses the existing CRAD sender.

לפני שימוש חי — בדקו יכולות פרוסות, הרשאות ומוכנות של החיבור שלכם.

בדקו את היכולות הפרוסות, הרשאות המפתח ומוכנות העסק בסביבה שלכם. דוגמאות HTTP נלכדו בבדיקות מבודדות; הסימון local-unreleased שלהן אינו אומר שה־API אינו פועל, ואינו מאשר את החיבור שלכם. במסלול הלקוח מאמתים טלפון בתבנית WhatsApp שהעסק הגדיר; SMS אינו נתמך. רישום בידי אדמין מורשה הוא פעולה נפרדת ללא קוד.

Grant only the campaign access you need

Check the campaign capability and resource grant returned by GET /v1/management for this business. The HTTP examples show isolated requests. Track an actual send through its campaign and recipient records.

Read operations require campaigns:read. Sending also requires campaigns:send. Inspect the current server key for these scopes and the campaign resource grant. Calendar and customer access alone do not authorize a campaign.

Choose the whole business for contacts, segments and all campaign history, or selected active providers for appointment customers only. A limited key chooses exactly one allowed provider per campaign. This permission includes recipient names, phone numbers and sending history.

Review before sending

  1. Load templates and capacity

    Show supported templates and completeness. Capacity is the shared rolling 300-message business allowance, not a reservation or a separate provider quota. A partial template catalogue cannot prove the outgoing version set.

    List campaign templatesRead campaign sending capacity
  2. Select recipients

    Use an appointment, contact or segment audience, subject to the campaign grant. Follow nextCursor with the same query. These pages are not customer-sync feeds. Submit up to 1,000 selected profile IDs in order; exclusions and phone deduplication must leave at most 300 recipients.

    Find campaign recipients
  3. Preview the exact draft

    Show every outgoing language, header, body, footer and supported button, together with recipient exclusions. Preserve the exact draft and the returned quoted cp… ETag. The preview saves no campaign and reserves no capacity.

    Preview an exact campaign
  4. Confirm and start

    After explicit confirmation, persist one UUID and submit {draft,confirm:true} with Idempotency-Key and the original preview ETag in If-Match. Current audience, consent, templates and binding are rechecked. Acceptance queues delivery through the existing sender; actual dispatch still depends on current channel and sender readiness.

    Confirm and start a campaign

Render the message and its languages

Template snapshots contain raw placeholders. Render BODY {{1}} with parameters[0], {{2}} with parameters[1], and so on. One ordered array is shared by every recipient and language; there is no per-recipient interpolation. For example, BODY "Hello {{1}}" with parameters ["Hala"] renders "Hello Hala".

The parameter count must equal the selected template placeholder count. Values are trimmed, nonblank, at most 200 characters, and cannot contain a carriage return, newline, tab or five consecutive spaces. Each filled body must fit 1,024 characters.

Supported new campaigns use BODY text parameters with a static TEXT header, static footer and static QUICK_REPLY, URL or PHONE_NUMBER buttons when present. Show those components unchanged. Media headers, header/footer/button variables, dynamic button URLs, named body parameters, FLOW and COPY_CODE buttons are unsupported.

With matchLanguage:false, everyone receives the selected template language. With true, CRAD selects an approved supported same-name variant with the same parameter count: customer ar* uses ar; en* prefers en, then en_US; other customer languages use he. If that eligible variant is absent at confirmation, use the selected language as fallback. Preview includes the variants to review; apply the same parameters to each.

A later change to the confirmed full variant set or its content, components, category or approval cannot silently fall back. Sending stops or pauses for review. Historical legacy_body campaigns retain their narrower body-only confirmation behavior.

Separate acceptance from delivery

An accepted receipt confirms the command, not completed delivery. Read current progress and recipient outcomes. sent records provider acceptance; unknown means the request may have been sent and cannot be automatically retried.

For an explicit continuation, eligible-failure retry or stop, retain a new command UUID and the current ccN control ETag. Delivery callbacks do not change this control version. Stop cannot retract a request already dispatched.

New campaigns confirm full template content. Historical legacy_body campaigns retain their original body-only confirmation and continuation behavior; CRAD does not manufacture a historical full-template approval. Meta can still change after the final external check.

Recover the same command

After a timeout, keep the entire original body, operation UUID and If-Match. GET campaign-operations/{operationId} only reads: it never creates, sends, settles, resumes or retries.

not_found does not cancel an earlier request still in flight. An explicit retry uses the original complete command. Changing input under the same UUID conflicts; generating a new UUID to escape uncertainty can duplicate the business action.

A currently authorized rotated key of the same integration can recover its command. A retained receipt can remain when current campaign state is unavailable. That does not authorize recreating the campaign.

Choose the next action from the error code

Read the JSON code, not only the HTTP status. After a lost or server-error command response, first recover the original operation. The fresh-decision actions below apply after a definite refusal or resolved prior result; they never justify replacing an uncertain command UUID.

HTTP / codeNext action
409 OPERATION_CONFLICT / CAMPAIGN_OPERATION_REUSEDRecover the original UUID. Do not change its request. A distinct reviewed command needs a new UUID only after prior acceptance is resolved.
409 CAMPAIGN_IN_PROGRESSRead the open campaign and deliberately continue or stop it. Do not create a competing campaign.
409 CAMPAIGN_NO_RECIPIENTSRefresh audience and eligibility, revise the selection and preview again.
422 CAMPAIGN_TOO_LARGEReduce the eligible selected recipients to at most 300 and preview again.
409 CAMPAIGN_DAILY_LIMITRead rolling capacity. Wait or reduce the selection, then preview again; capacity is not reserved.
412 CAMPAIGN_PREVIEW_CHANGEDRefresh templates and audience, review a fresh preview, and submit a new confirmed command with a new UUID.
412 CAMPAIGN_VERSION_CONFLICTRead current campaign and ccN ETag, decide again, then use a new command UUID with the fresh version.
409 TEMPLATE_CHANGED / 422 TEMPLATE_UNSUPPORTEDRefresh the catalogue, choose an approved supported template and preview it again.
503 TEMPLATES_INCOMPLETE / TEMPLATES_UNAVAILABLERetry template reading or preview later. Never confirm an incomplete catalogue.