diff --git a/apps/builder/src/features/preview/components/ApiPreviewInstructions.tsx b/apps/builder/src/features/preview/components/ApiPreviewInstructions.tsx index 4c740432e..befe61e2c 100644 --- a/apps/builder/src/features/preview/components/ApiPreviewInstructions.tsx +++ b/apps/builder/src/features/preview/components/ApiPreviewInstructions.tsx @@ -18,22 +18,12 @@ export const ApiPreviewInstructions = (props: StackProps) => { const startParamsBody = startPreviewAtGroup ? `{ - "startParams": { - "typebot": "${typebot?.id}", - "isPreview": true, "startGroupId": "${startPreviewAtGroup}" - } -}` - : `{ - "startParams": { - "typebot": "${typebot?.id}", - "isPreview": true - } }` + : undefined const replyBody = `{ "message": "This is my reply", - "sessionId": "" }` return ( @@ -60,12 +50,16 @@ export const ApiPreviewInstructions = (props: StackProps) => { - with the following JSON body: - + {startPreviewAtGroup && ( + <> + with the following JSON body: + + + )} @@ -82,7 +76,7 @@ export const ApiPreviewInstructions = (props: StackProps) => { lang={'shell'} value={`${parseApiHost( typebot?.customDomain - )}/api/v2/sendMessage`} + )}/api/v1/sessions//continueChat`} /> With the following JSON body: @@ -95,7 +89,10 @@ export const ApiPreviewInstructions = (props: StackProps) => { Check out the{' '} - + API reference {' '} for more information diff --git a/apps/builder/src/features/publish/components/embeds/modals/ApiModal.tsx b/apps/builder/src/features/publish/components/embeds/modals/ApiModal.tsx index 351f2fc9b..4ccb9a8d9 100644 --- a/apps/builder/src/features/publish/components/embeds/modals/ApiModal.tsx +++ b/apps/builder/src/features/publish/components/embeds/modals/ApiModal.tsx @@ -27,15 +27,9 @@ export const ApiModal = ({ onClose, }: ModalProps): JSX.Element => { const { typebot } = useTypebot() - const startParamsBody = `{ - "startParams": { - "typebot": "${publicId}", - } -}` const replyBody = `{ "message": "This is my reply", - "sessionId": "" }` return ( @@ -61,10 +55,8 @@ export const ApiModal = ({ lang={'shell'} value={`${parseApiHost( typebot?.customDomain - )}/api/v2/sendMessage`} + )}/api/v1/typebots/${publicId}/startChat`} /> - with the following JSON body: - @@ -81,7 +73,7 @@ export const ApiModal = ({ lang={'shell'} value={`${parseApiHost( typebot?.customDomain - )}/api/v2/sendMessage`} + )}/api/v1/sessions//continueChat`} /> With the following JSON body: @@ -94,10 +86,7 @@ export const ApiModal = ({ Check out the{' '} - + API reference {' '} for more information