Updated on 2023-09-27 GMT+08:00

Q&A Query Interface

Interface Method

The request method must be set to POST.

URL

https://IP:PORT/oifde/rest/api/faq/query

Request

Table 1 Parameters in the request body

Parameter

Type

Position

Mandatory

Description

tenantId

String

body

Yes

Tenant ID.

faqGroupId

Integer

body

Yes

FAQ group ID.

name

String

body

No

Question in a Q&A. If this parameter is not set, all Q&As are returned.

pageNum

Integer

body

Yes

Page number.

Number of the page to be queried. The value is 1 for the first page.

pageSize

Integer

body

Yes

Number of records on each page.

authToken

String

body

Yes

Authentication token.

For details, see C3 OIAP Interface Authentication.

Response

Parameter

Type

Position

Mandatory

Description

data

FaqElementModel[]

body

Yes

Q&A data.

totalSize

Integer

body

Yes

Total number of records.

Table 2 FaqElementModel

Parameter

Type

Position

Mandatory

Description

id

Integer

body

Yes

Internal sequence number.

faqGroupId

Integer

body

Yes

FAQ group ID.

question

String

body

Yes

Question, which contains a maximum of 8192 characters.

simQuestions

SimStatementUnit[]

body

No

Similar question. A maximum of 100 similar questions are allowed.

answer

String

body

Yes

Answer, which contains a maximum of 8192 characters.

simAnswers

SimStatementUnit[]

body

No

Similar answer. A maximum of 100 similar answers are allowed.

keywords

KeywordUnit[]

body

No

Keyword. A maximum of 20 keywords are supported.

Table 3 SimStatementUnit

Parameter

Type

Position

Mandatory

Description

id

Integer

body

Yes

Internal sequence number.

elementId

Integer

body

Yes

Q&A ID.

statement

String

body

Yes

Question or answer content, which contains a maximum of 8192 characters.

type

String

body

Yes

Q: question

A: answer

Table 4 KeywordUnit

Parameter

Type

Position

Mandatory

Description

w

String

body

Yes

Keyword, which contains a maximum of 64 characters.

Example

  • Request
    {
        "tenantId": "00030010",
        "faqGroupId":10000,
        "name":"",
        "pageNum":1,
        "pageSize":10,
        "authToken": "e**************************"
    }
  • Response
    {
       "data":    [
                {
             "id": 10007,
             "faqId": 10000,
             "question": "What is a Q&A chatbot?",
             "simQuestions": [],
             "answer": " A Q&A chatbot automatically provides answers to users' questions.",
             "simAnswers": [],
             "keywords": []
          },
                {
             "id": 10008,
             "faqId": 10000,
             "question": "What is a task-oriented chatbot?",
             "simQuestions": [],
             "answer": " A chatbot oriented for accomplishing a series of tasks (such as air ticket booking, meal ordering, and RBT subscription) with clear objectives.",
             "simAnswers": [],
             "keywords": []
          }
       ],
       "totalSize": 2
    }