Verify semantic entries¶
Verify whether the current knowledge base and its semantic entries comply with the server contract.
POST $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/validate
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the knowledge base list to obtain the knowledge base ID.
Set the operation-specific values used in the request:
$MODEL_ID: Knowledge base ID to be verified.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/validate" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameters |
Type |
Description |
|---|---|---|
|
integer |
The ID of the knowledge base to be verified. |
Successful response¶
Returns 200 on success. HTTP is successful but data.valid is false, indicating that the model has not passed business verification; press errors to correct the entry or source and call again.
{
"code": "OK",
"msg": "OK",
"data": {
"valid": false,
"errors": ["entry total_rows is invalid"]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
boolean |
Whether the current knowledge base passes the server-side verification. |
|
string[] |
Error list when verification fails; may be omitted or empty when verification passes. |
[] after a type means an array. For example, string[] is an array of strings.
Error response¶
{
"code": "ErrNotFound",
"msg": "resource not found",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the knowledge base ID from the response. |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have permission to use the knowledge base. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible. |
Reconfirm |
|
|
The service failed to perform verification. |
Keep the desensitized response information and try again. |
Follow-up operations¶
After pressing errors to correct it, Query semantic entries confirms the entry definition, and then calls this interface again.