BizKitHub
postChatVeřejné 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 v query · JSON tělo

Parametry v query

· 1
apiKeystringPovinné

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

PříkladPRODPGrFxpGEtrOZfuWhnoJohUYBXuOE

Tělo požadavku

application/json
questionstringPovinné

The user prompt.

Délka: 1–∞
roomIdstringVolitelné

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

Délka: 24
PříkladZUiVZuKwAaXNoT4nGUbnKR75
modelstringVolitelné
Délka: 0–100
sourcestringVolitelné
Délka: 0–32
externalUserRefstringVolitelné
Délka: 0–64
contactExternalIdstringVolitelné
Délka: 16
metadataobjectVolitelné

Schéma odpovědi

1 zdokumentovaný stavový kód

200Úspěch
roomIdstringPovinné

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

Délka: 24
PříkladZUiVZuKwAaXNoT4nGUbnKR75
userMessageIdstringPovinné

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

Délka: 24
assistantMessageIdstringPovinné

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

Délka: 24
answerstringPovinné

Ukázka odpovědi

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

Ukázka požadavku

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": {}
}'

Potřebujete API klíč?

Všechny veřejné endpointy BizKitHub API se ověřují API klíčem.

Získat API klíč