The token’s scope
Create the token with only the permissions this case uses:DELETE and no PUT, because this integration never deletes or edits anything.
If one day it needs to update contacts, add contacts: PUT to the token.
1
Fetch the fixed ids once
The outbound channel and the CRM board do not change from one order to the next. Fetch the ids
once and keep them in configuration:
2
Register or update the contact
Creating with
POST /contacts returns an error when the customer has bought before. Use the
upsert, which creates the contact or updates the existing one by number:3
Notify the customer
Outside WhatsApp’s 24-hour window, the first message must be an approved template:The idempotency key uses the order id, so it is always the same for that order. If your routine
runs twice, the customer gets a single message. To follow the
jobId, see
Sending messages.4
Open the card on the board
To create the card, provide a name, a board and a stage. The contact is linked in a second call,
on the linking endpoint:The link uses
contact.id, which is the id returned in step 2. Connecta DESK ids are only valid
inside Connecta DESK. The order id from your system goes in the card’s name or in a custom
field.The patterns that repeat
Upsert instead of create
Upsert instead of create
It is common for an integration to process the same data more than once, because of a retry, a
reprocessing run or a human error. When an upsert endpoint exists, prefer it. That way the
routine can run again without creating duplicate records.
Look up by your system's identifier
Look up by your system's identifier
Store your system’s identifier in a Connecta DESK field (
code on the contact, sku on the
product) and search by it. That way the integration can run again without problems, and you do
not need to maintain a table that maps your ids to Connecta DESK’s.Idempotency on everything with an external effect
Idempotency on everything with an external effect
A message sent and a card created are things the end customer sees. On both calls, send an
Idempotency-Key built from a piece of your business data, such as the order id.Store what does not change
Store what does not change
Channels, boards, stages, queues, tags and custom fields almost never change. Fetching them on
every run is the most common way to use up the per-minute limit for no reason.
Before going to production
The token has only the modules and methods the routine uses, with no
DELETE “just in case”.The key is in an environment variable or a secrets vault, never in the repository.
Every call that produces something the customer can see sends an
Idempotency-Key built from an
identifier in your system.The integration tells a final error (
4xx, do not repeat) apart from a temporary one (429 and
5xx, repeat after waiting). See Errors.The log records
error.code, method and path for every failure. Support uses this information to
locate the request.If the token has an expiry, the expiration date is written down alongside the integration. An
expired token gets the same
401 as a wrong token.
