Example B · Invite & Send¶
Gateway invites a cloud operator → peer joins → send an encrypted message.
Scenario: A factory gateway (factory-gw-01) connects to an ops-center operator and sends a status update.
Prerequisites¶
- Gateway running (Example A)
- Active license (License Management)
- Operator has Privitty Edge, mobile, or desktop client to accept the invite
Step 1 — Gateway generates invite¶
On the gateway:
curl -s -X POST http://127.0.0.1:7200/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"get_chat_securejoin_qr_code","params":[1,null],"id":1}' | jq -r .result
Output (example):
Or via CLI:
Share this link with the operator (e-mail, ticketing system, QR code).
Step 2 — Operator joins¶
On the operator device (different account):
Warning
The invite link must come from a different account. Joining your own invite will fail.
Monitor join progress on the gateway via SSE:
Look for SecurejoinInviterProgress with progress: 1000.
Step 3 — Resolve operator's chat ID¶
After join completes, list chats:
curl -s -X POST http://127.0.0.1:7200/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"get_chatlist_entries","params":[1,null,null,null],"id":1}' | jq .
curl -s -X POST http://127.0.0.1:7200/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"get_chatlist_items_by_entries","params":[1,[7]],"id":2}' | jq .
Note the chat ID (e.g. 7) for the operator conversation.
Step 4 — Send encrypted message¶
curl -s -X POST http://127.0.0.1:7200/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"send_msg","params":[1,7,{"text":"Line 3 batch complete — 1,240 units"}],"id":3}' | jq .
Message ID 88 confirms the send was queued.
Step 5 — Confirm delivery (optional)¶
Watch SSE for delivery receipts:
data: {"type":"MsgDelivered","account_id":1,"chat_id":7,"msg_id":88}
data: {"type":"MsgRead","account_id":1,"chat_id":7,"msg_id":88}
Next¶
- Example C · Send a File — encrypted file transfer