diff --git a/api.rest b/api.rest index 0e285257fe..483ef66208 100644 --- a/api.rest +++ b/api.rest @@ -65,6 +65,74 @@ Authorization: Bearer {{authToken}} # Set the absolute path of the archive, or relative to where VS Code was executed from < ./.rest-client/responses/body/archive.tgz + +# ============================================ +# Botpress HITL API +# ============================================ + +# -------------------------------------------- +# Get list of conversations (sessions) +# -------------------------------------------- +### +GET {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions?archived=false +Authorization: Bearer {{authToken}} +Content-Type: application/json + +# -------------------------------------------- +# Get list of dialogs (sessions) +# -------------------------------------------- +@sessionId = 13455 +### +GET {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}} +Authorization: Bearer {{authToken}} +Content-Type: application/json + +# -------------------------------------------- +# Get list of session messages +# -------------------------------------------- +### +POST {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}}/message +Authorization: Bearer {{authToken}} +Content-Type: application/json + +{ + "message": "Hello, just a bit more", + "sender": "agent" +} + +# -------------------------------------------- +# Pause the dialogue +# -------------------------------------------- +### +POST {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}}/pause +Authorization: Bearer {{authToken}} +Content-Type: application/json + +# -------------------------------------------- +# Check pause status +# -------------------------------------------- +### +POST {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}}/isPaused +Authorization: Bearer {{authToken}} +Content-Type: application/json + +# -------------------------------------------- +# Unpause the dialogue +# -------------------------------------------- +### +POST {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}}/unpause +Authorization: Bearer {{authToken}} +Content-Type: application/json + +# -------------------------------------------- +# Get bot-wide HITL config +# -------------------------------------------- +### +GET {{baseUrl}}/api/v1/bots/{{botId}}/mod/hitl/config/attributes +Authorization: Bearer {{authToken}} + + + ### SETUP # Use with https://marketplace.visualstudio.com/items?itemName=humao.rest-client