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

Q&A Creation Interface

Interface Method

POST

URL

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

Request

Parameter

Type

Position

Mandatory

Description

tenantId

String

Body

Yes

Tenant ID.

model

FaqElementModel

Body

Yes

Q&A model.

authToken

String

Body

Yes

Authentication token.

For details, see C3 OIAP Interface Authentication.

Table 1 FaqElementModel

Parameter

Type

Position

Mandatory

Description

id

Integer

Body

No

Internal sequence number. Set this parameter to -1 during creation. If this parameter is left empty, the default value -1 is used.

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 allowed. The value must not contain vertical bars (|).

Table 2 SimStatementUnit

Parameter

Type

Position

Mandatory

Description

id

Integer

Body

Yes

Internal sequence number.

elementId

Integer

Body

No

Q&A ID. If this parameter is left blank, the default value -1 is used.

statement

String

Body

Yes

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

type

String

Body

Yes

Q: question

A: answer

Table 3 KeywordUnit

Parameter

Type

Position

Mandatory

Description

w

String

Body

Yes

Keyword, which contains a maximum of 64 characters.

Response

Parameter

Type

Position

Mandatory

Description

faqGroupModel

FaqModel

Body

Yes

Q&A data.

faqModel

FaqElementModel

Body

Yes

Q&A object data.

errorCode

String

Body

Yes

Error code.

  • 0: success
  • Other values: failure

errorMsg

String

Body

No

Error description.

Example

  • Request
    {
        "tenantId":"00030010",
        "authToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "model": {
            "id": -1,
            "faqGroupId": 10012,
            "question": "House purchase restriction in Nanjing",
            "simQuestions": [
                {
                    "statement": "House purchase restriction policies in Nanjing",
                    "type": "Q"
                }
            ],
            "answer": "Each household can purchase at most two houses.",
            "simAnswers": [
                {
                    "statement": "Each household can purchase at most two houses.",
                    "type": "A"
                }
            ],
            "keywords": [
                {
                    "w": "Purchase restriction"
                }
            ]
        }
    }
  • Response
    { 
         "errorCode" : "0",
         "errorMsg" : "" 
     }