SidetalkGuides
Open Sidetalk

Training Data Input API


Purpose

This API saves question-and-answer data to Sidetalk with a specified category ID.

URL


HTTP method

POST

Headers

HeadersValueDescription
Content-Typeapplication/jsonIndicates that the request body is JSON.
AuthorizationBearer <api_key>Use the API key provided under Install in the Sidetalk dashboard.

Body

ParameterTypeRequiredDescription
categoryIdStringNoThe category ID for the questions and answers. Manage categories in AI Category Management in the Sidetalk dashboard.
questionStringYesThe user question. Pass one question as a string.
answerStringYesThe answer to the question.

Example request

Bash
curl -X POST https://api.sidetalk.ai/v1/knowledge/qna \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${API_KEY}" \
  -d '{
      "categoryId": "1",
      "question": "μ•ˆλ…•ν•˜μ„Έμš”, 도움이 ν•„μš”ν•΄μš”.",
      "answer": "μ•ˆλ…•ν•˜μ„Έμš”! 무엇을 λ„μ™€λ“œλ¦΄κΉŒμš”?"
  }'

Response format

Success response (200 OK)

When the request succeeds and question-and-answer data is saved, the following response is returned.

Response body

JSON
{
  "success": true,
  "data": {
    "site_id": //ν•΄λ‹Ή site_id,
    "categoryId": "1",
    "question": "μ•ˆλ…•ν•˜μ„Έμš”, 도움이 ν•„μš”ν•΄μš”.",
    "answer": "μ•ˆλ…•ν•˜μ„Έμš”! 무엇을 λ„μ™€λ“œλ¦΄κΉŒμš”?",
    "created_at": "20241108120639",
  },
  "message": "Data has been successfully saved."
}

Response fields

FieldTypeDescription
successbooleanIndicates that the request succeeded; always true.
dataobjectContains information about the saved data.
data.site_idintegerThe site ID used for the request.
data.categoryIdstringThe category ID of the saved question and answer.
data.questionstringThe saved question.
data.answerstringThe saved answer.
data.created_atstringThe time the data was saved.
messagestringA message indicating request success.

Error response (500 Internal Server Error)

If a server error or request processing problem occurs, the following response is returned.

Response body

JSON
{
  "success": false,
  "error": "였λ₯˜ λ©”μ‹œμ§€ λ‚΄μš©"
}

Error response fields

FieldTypeDescription
successbooleanIndicates that the request failed; always false.
errorstringIncludes the error message and provides the cause of the problem.