0

I set up a test bot in a botpress environment and am trying to access the chat via the converse api (is this not the right way?), using these endpoints:

Login on the Admin UI # @name login POST {{baseUrl}}/api/v1/auth/login/basic/default Content-Type: application/x-www-form-urlencoded

email={{email}}&password={{password}}

@authToken = {{login.response.body.payload.jwt}}

List All Bots (need to login first) GET {{baseUrl}}/api/v1/admin/bots Authorization: Bearer {{authToken}} X-BP-Workspace: default

@botId = YOUR_BOT_ID

Send a request using Converse POST {{baseUrl}}/api/v1/bots/{{botId}}/converse/{{userId}} Content-Type: application/json

{ "type": "text", "text": "hey" }

...I can authenticate okay and receive the bot list. But the last, most important call does not work. I authenticate with my admin account. In the conversation studio it is not possible to create users. Where do I get "userId" from?

wiseguybec
  • 79
  • 1
  • 5
  • 1
    userid is the unique identifier of the incoming request, in case of messaging apps like whatsapp and telegram userid is the phone number. You need to also add the Authorization header to the converse api – Emmalex6250 Apr 21 '22 at 12:52

0 Answers0