BizKitHub
postChatPubliczne API v1

/api/v1/chat/ai-turn

Persists both messages in cas__chat_message and returns the answer + ids. Creates the room when roomId is omitted.

chatpostApiV1ChatAi-turn

Parametry

1 w query · Treść JSON

Parametry query

· 1
apiKeystringWymagane

Your BizKitHub API key (passed as GET parameter).

Key format: A 32-character string matching: ^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$
Prefixes: PROD (production key), DEV_ (individual developer), ROOT (system key with no limits). Learn more

PrzykładPRODPGrFxpGEtrOZfuWhnoJohUYBXuOE

Treść żądania

application/json
questionstringWymagane

The user prompt.

Długość: 1–∞
roomIdstringOpcjonalne

Chat room public id (cas__chat_room.external_id), 24 chars.

Długość: 24
PrzykładZUiVZuKwAaXNoT4nGUbnKR75
modelstringOpcjonalne
Długość: 0–100
sourcestringOpcjonalne
Długość: 0–32
externalUserRefstringOpcjonalne
Długość: 0–64
contactExternalIdstringOpcjonalne
Długość: 16
metadataobjectOpcjonalne

Schemat odpowiedzi

1 udokumentowany kod statusu

200Sukces
roomIdstringWymagane

Chat room public id (cas__chat_room.external_id), 24 chars.

Długość: 24
PrzykładZUiVZuKwAaXNoT4nGUbnKR75
userMessageIdstringWymagane

Chat message public id (cas__chat_message.external_id), 24 chars.

Długość: 24
assistantMessageIdstringWymagane

Chat message public id (cas__chat_message.external_id), 24 chars.

Długość: 24
answerstringWymagane

Przykład odpowiedzi

application/json
{
  "roomId": "ZUiVZuKwAaXNoT4nGUbnKR75",
  "userMessageId": "example_userMessageId",
  "assistantMessageId": "example_assistantMessageId",
  "answer": "example_answer"
}

Przykład żądania

POST /api/v1/chat/ai-turn

post
curl -X POST "https://api.bizkithub.com/api/v1/chat/ai-turn?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "question": "example_question",
  "roomId": "ZUiVZuKwAaXNoT4nGUbnKR75",
  "model": "example_model",
  "source": "example_source",
  "externalUserRef": "example_externalUserRef",
  "contactExternalId": "example_contactExternalId",
  "metadata": {}
}'

Potrzebujesz klucza API?

Wszystkie publiczne endpointy BizKitHub API uwierzytelniają się kluczem API.

Uzyskaj klucz API