Skip to content

WhatsApp

Riversoft® STCP DirectLink uses Meta’s WhatsApp Business Platform to deliver documents to people through WhatsApp and to receive the documents they send back.

ComponentWho starts the connectionFunction
WhatsApp connectorRiversoft STCP DirectLink (outbound connection)Sends documents, secure links and PINs to the recipient’s mobile phone.
WhatsApp DirectLink serviceMeta (inbound connection)Receives the documents contacts send through WhatsApp and writes them to the mailbox.

Outbound connections (WhatsApp connector)

    flowchart LR
    subgraph DL[Riversoft STCP DirectLink]
      SA["saida directory"]
      C[WhatsApp connector]
    end
    SA --> C
    C -->|document or link| M[WhatsApp Business Platform]
    M --> W[Recipient's mobile phone]
  

Riversoft STCP DirectLink sends the documents available in the user’s mailbox (saida directory), by schedule or when the operator starts the connection in the Riversoft Console Portal. The recipient comes from the file name, in the <mobile>@<file-name> format: the number is the part before the first @.

Delivery modeWhat the recipient receives
DocumentThe file itself, as a WhatsApp document.
Meta linkA link to download the file, hosted by Meta.
Secure linkA button with the Riversoft STCP DirectLink secure link to download the file.
Secure link with PINThe button with the secure link and a PIN, required at download.

Messages use the templates approved for the account at Meta. The WhatsApp connector only sends: it does not fetch files.

Inbound connections (WhatsApp DirectLink service)

    flowchart LR
    subgraph DL[Riversoft STCP DirectLink]
      S[WhatsApp DirectLink service]
      EN["entrada directory"]
    end
    W[Contact's mobile phone] -->|document| M[WhatsApp Business Platform]
    M -->|webhook| S
    S --> EN
  

When a contact sends a document to the company’s WhatsApp number, Meta notifies the WhatsApp DirectLink service (webhook). The service downloads the document and writes it to the entrada directory of the user’s mailbox, with the name <mobile>@<document-name>, to identify the sender.

The WhatsApp DirectLink service is registered in the instance network services, in the Riversoft Console Portal, with the public webhook address, the Meta application credentials and the templates directory.

What to prepare at Meta

ItemDescription
AccountWhatsApp Business account, with the company’s phone number.
ApplicationMeta application, with the application secret and a system user token.
WebhookPublic WhatsApp DirectLink service URL and the verification token, registered in the application.
TemplatesMessage templates approved for the delivery modes used.

The user registration in the Riversoft Console Portal holds the phone number ID, the credential token and the delivery mode.

Security

  • For sensitive documents, prefer the secure link with PIN: the file does not stay in the conversation and the download requires the code.
  • Publish the WhatsApp DirectLink service over HTTPS only.
  • Keep the application secret and the Meta tokens as credentials.