SidetalkGuides
Sidetalk website ↗Open dashboard

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.