chatbots/
GET
request to https://api.botpress.cloud/v1/chat/conversations
adding the following headers: Authorization: Bearer <your-personal-access-token>
and x-bot-id: <your-bot-id>
.
This is how the request would look like using Axios in a Javascript application (e.g in a Execute Code in Botpress):
nextToken
property to fetch the next batch of conversations. The nextToken
property is returned in the meta
object of the response.nextToken
property retrieved from the first request as a parameter to the function, then update it on subsequent calls. More about pagination here.
allMessages
array is gonna look like:
payload
property.history
string will end up looking like this:
formatMessage
function to have different formatting or to return more information of the messages. Now use the history
variable however you like - send it via email, add it to a Google Sheets document, send it to Botpress to do further processing, etc.