我已经使用API成功创建了我的知识库。但我忘了为其中一对添加一些替代问题和元数据。
我注意到PATH
API 中更新知识库的方法,因此支持更新 kb。我创建了一个如下所示的有效负载:
{
"add": {
},
"delete": {
},
"update": {
"qnaList": [
{
"id": 1,
"answer": "Answer",
"source": "link_to_source",
"questions": [
"Question 1?",
"Question 2?"
],
"metadata": [
{
"name": "oldMetadata",
"value": "oldMetadata"
},
{
"name": "newlyAddedMetaData",
"value": "newlyAddedMetaData"
}
]
}]}
}
我得到以下回复HTTP 202 Accepted
:
{
"operationState": "NotStarted",
"createdTimestamp": "2018-05-21T07:46:52Z",
"lastActionTimestamp": "2018-05-21T07:46:52Z",
"userId": "user_uuid",
"operationId": "operation_uuid"
}
所以,看起来它奏效了。但实际上,此请求不会产生任何影响。
当我检查操作详细信息时,它会返回以下内容:
{
"operationState": "Succeeded",
"createdTimestamp": "2018-05-21T07:46:52Z",
"lastActionTimestamp": "2018-05-21T07:46:54Z",
"resourceLocation": "/knowledgebases/kb_uuid",
"userId": "user_uuid",
"operationId": "operation_uuid"
}
我究竟做错了什么?我应该如何通过 API 正确更新我的 kb?
请帮忙