From d669dbe54bddea500fc81c1446b3563e44a08102 Mon Sep 17 00:00:00 2001 From: devlikepro Date: Sun, 18 Aug 2024 12:36:05 +0700 Subject: [PATCH] [core] Use new API to create a session --- README.md | 2 +- examples/python/README.md | 4 ++-- src/core/manager.core.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index add6025f..f5ed7853 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ later: How to log in - the instruction on WhatsApp site -When your ready - find `POST /api/session/start`, click on **Try it out**, then **Execute** a bit below. +When your ready - find `POST /api/sessions`, click on **Try it out**, then **Execute** a bit below. The example payload: diff --git a/examples/python/README.md b/examples/python/README.md index f26d87d2..a4c10ca8 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -50,8 +50,8 @@ docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bo 2. Open Swagger API in the browser http://localhost:3000/ 3. Start session and scan QR code in swagger - 1. Find `POST /api/session/start` request press **Try it out** and - **Execute** it with `default` session name + 1. Find `POST /api/sessions/` request press **Try it out** and **Execute** it + with `default` session name 2. Find `GET /api/screenshot` and execute it - it must show QR code 3. Scan QR code on your mobile WhatsApp application (that installed on your phone) diff --git a/src/core/manager.core.ts b/src/core/manager.core.ts index ad4f0a89..8e11bed2 100644 --- a/src/core/manager.core.ts +++ b/src/core/manager.core.ts @@ -248,7 +248,8 @@ export class SessionManagerCore extends SessionManager { const session = this.session; if (!session) { throw new NotFoundException( - `We didn't find a session with name '${name}'. Please start it first by using POST /sessions/start request`, + `We didn't find a session with name '${name}'. + Please start it first by using POST /sessions/${name}/start request`, ); } return session;