From 14613b61d32baf8da3914d8a8dea54544a483eea Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 26 Jun 2024 16:42:54 +0200 Subject: [PATCH] :pencil: Add API deploy doc Closes #1454 --- apps/docs/deploy/api/overview.mdx | 35 +++++++++++++++++++++++++++++++ apps/docs/mint.json | 5 +++++ 2 files changed, 40 insertions(+) create mode 100644 apps/docs/deploy/api/overview.mdx diff --git a/apps/docs/deploy/api/overview.mdx b/apps/docs/deploy/api/overview.mdx new file mode 100644 index 000000000..8b01cf53a --- /dev/null +++ b/apps/docs/deploy/api/overview.mdx @@ -0,0 +1,35 @@ +--- +sidebarTitle: Overview +title: API +--- + +Your bot can also be executed with HTTP requests. This is useful if you want to integrate your bot with another service or if you want to use it in a different programming language. + +## Test + +1. All your requests need to be authenticated with an API token. [See instructions](/api-reference/authentication). +2. To start the chat, send a POST request to `https://typebot.io/api/v1/typebots//preview/startChat` The first response will contain a sessionId that you will need for subsequent requests. +3. To send replies, send POST requests to `https://typebot.io/api/v1/sessions//continueChat` + With the following JSON body: + + ```json + { + "message": "This is my reply" + } + ``` + +Check out the [Start preview chat API reference](/api-reference/chat/start-preview-chat) for more information + +## Live + +1. To start the chat, send a POST request to `https://typebot.io/api/v1/typebots//startChat` The first response will contain a sessionId that you will need for subsequent requests. +2. To send replies, send POST requests to `https://typebot.io/api/v1/sessions//continueChat` + With the following JSON body: + + ```json + { + "message": "This is my reply" + } + ``` + +Check out the [Start chat API reference](/api-reference/chat/start-chat) for more information diff --git a/apps/docs/mint.json b/apps/docs/mint.json index 91736ee5a..567e11199 100644 --- a/apps/docs/mint.json +++ b/apps/docs/mint.json @@ -177,6 +177,11 @@ "deploy/whatsapp/overview", "deploy/whatsapp/create-meta-app" ] + }, + { + "group": "API", + "icon": "code-simple", + "pages": ["deploy/api/overview"] } ] },