Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(sdk): link the account before sending in every quickstart

Yudhi Armyndharisaa2c5ab75345
diff --git a/docs/18-sdk-design.md b/docs/18-sdk-design.md
index a3d448104..91c0f1fbf 100644
--- a/docs/18-sdk-design.md
+++ b/docs/18-sdk-design.md
@@ -83,6 +83,9 @@ async function main() {
const session = await client.sessions.create({ name: 'my-session' });
await client.sessions.start(session.id);
+ // Link the account before sending: scan sessions.getQrCode or use sessions.requestPairingCode,
+ // then wait for status 'ready'. An unlinked session answers the send with 409.
+
// Send a text message.
const result = await client.messages.sendText(session.id, {
chatId: '[email protected]',
@@ -450,6 +453,9 @@ client = OpenWAClient(
session = client.sessions.create({"name": "my-session"})
client.sessions.start(session["id"])
+# Link the account before sending: scan sessions.get_qr_code or use sessions.request_pairing_code,
+# then wait for status "ready". An unlinked session answers the send with 409.
+
# Send a text message
result = client.messages.send_text(session["id"], {
"chatId": "[email protected]",
@@ -816,6 +822,8 @@ $client = new Client([
$session = $client->sessions->create(['name' => 'my-session']);
$client->sessions->start($session['id']);
+// Link the account before sending: scan sessions->getQrCode or use sessions->requestPairingCode,
+// then wait for status 'ready'. An unlinked session answers the send with 409.
$result = $client->messages->sendText($session['id'], [
'chatId' => '[email protected]',
'text' => 'Hello from the OpenWA PHP SDK!',
diff --git a/sdk/go/README.md b/sdk/go/README.md
index 956e7a7a0..60323f786 100644
--- a/sdk/go/README.md
+++ b/sdk/go/README.md
@@ -52,6 +52,8 @@ func main() {
log.Fatal(err)
}
+ // Link the account before sending: scan Sessions.QRCode or use Sessions.RequestPairingCode,
+ // then wait for status "ready". An unlinked session answers the send with 409.
res, err := client.Messages.SendText(ctx, session.ID, openwa.SendTextRequest{
ChatID: "[email protected]",
Text: "Hello from the OpenWA Go SDK!",
diff --git a/sdk/java/README.md b/sdk/java/README.md
index a63583db6..e44a88591 100644
--- a/sdk/java/README.md
+++ b/sdk/java/README.md
@@ -54,6 +54,8 @@ OpenWAClient client = new OpenWAClient("http://localhost:2785", "owa_k1_…");
SessionResponse session = client.sessions.create(CreateSessionRequest.builder().name("my-session").build());
client.sessions.start(session.id());
+// Link the account before sending: scan sessions.getQrCode or use sessions.requestPairingCode,
+// then wait for status READY. An unlinked session answers the send with 409.
MessageResponse result = client.messages.sendText(session.id(),
SendTextRequest.builder()
.chatId("[email protected]")
diff --git a/sdk/php/README.md b/sdk/php/README.md
index 5774dc31d..1b5db737d 100644
--- a/sdk/php/README.md
+++ b/sdk/php/README.md
@@ -39,6 +39,8 @@ $client = new Client([
$session = $client->sessions->create(['name' => 'my-session']);
$client->sessions->start($session['id']);
+// Link the account before sending: scan sessions->getQrCode or use sessions->requestPairingCode,
+// then wait for status 'ready'. An unlinked session answers the send with 409.
$result = $client->messages->sendText($session['id'], [
'chatId' => '[email protected]',
'text' => 'Hello from the OpenWA PHP SDK!',
diff --git a/sdk/python/README.md b/sdk/python/README.md
index c89450261..1a8962a14 100644
--- a/sdk/python/README.md
+++ b/sdk/python/README.md
@@ -35,6 +35,8 @@ client = OpenWAClient(
session = client.sessions.create({"name": "my-session"})
client.sessions.start(session["id"])
+# Link the account before sending: scan sessions.get_qr_code or use sessions.request_pairing_code,
+# then wait for status "ready". An unlinked session answers the send with 409.
result = client.messages.send_text(session["id"], {
"chatId": "[email protected]",
"text": "Hello from the OpenWA Python SDK!",