Update Fact-Organization Mapping API
This API allows to modify the already customized System Facts as per each organization's needs across different tenants. After modification, the response includes the Fact and Organization mappings with an updated version number, which increments on every change. Using this API, you can modify the Query, Values (choices), and LLM predicted values (allow other). It is recommended to add the Query and Values in the respective language of the Fact. In addition to English, Spanish is supported.
Endpoint
Method: PUT
URL: https://<<Hostname>>/uzng-conversation-facts-backend/cf/v2/fact-org-mapping/<fact-id>
curl -X PUT "https://<api-base-url>/uzng-conversation-facts-backend/cf/v2/fact-org-mapping/<fact-id>" \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{
"orgIds": ["org1", "org2"],
"query": "How satisfied are you with our service?",
"choices": ["Very Satisfied", "Satisfied", "Neutral", "Dissatisfied", "Very Dissatisfied"],
"allowOther": true
}'
Header Parameter
Authorization - Bearer <Token>
Note
To obtain an authorization token, click here.
Sample Request Parameter
'{
"orgIds": ["org1", "org2"],
"query": "How satisfied are you with our service?",
"choices": ["Very Satisfied", "Satisfied", "Neutral", "Dissatisfied", "Very Dissatisfied"],
"allowOther": true
}'
Path Parameter
Parameter Name | Data type | Description | Required/ Optional |
|---|---|---|---|
factId | String | The ID of the System Fact that needs to be customized. | Required |
Request Parameter
Parameter Name | Data type | Description | Required/ Optional |
|---|---|---|---|
orgIds | String | The List of Organization IDs for which the System Facts needs to be modified after customization. | Required |
query | Text | The Query to be modified for the given Organization IDs and Fact ID. | Required |
choices | String | The Choices (values) to be modified for the given Organization IDs and Fact ID. | Optional |
allowOther | Boolean | If set to True, LLM predicted choices can be added for the given Organization IDs. If set to False, the LLM predicted choices are ignored. | Optional |
Sample Response
{
"success": true,
"result": [
{
"id": "64a1b2c3d4e5f6g7h8i9j0k1",
"factId": "fact_123",
"tenantId": "tenant_xyz",
"orgIds": ["org1"],
"factName": "Customer Satisfaction",
"query": "Updated query for this organization",
"responseType": "CATEGORICAL",
"choices": ["New Option 1", "New Option 2"],
"allowOther": true,
"defaultValue": "New Option 1",
"status": "APPROVED",
"version": 2,
"createdBy": "user@example.com",
"updatedBy": "user@example.com",
"createdDate": 1702834567890,
"updatedDate": 1702834600000
},
{
"id": "64a1b2c3d4e5f6g7h8i9j0k2",
"factId": "fact_123",
"tenantId": "tenant_xyz",
"orgIds": ["org2"],
"factName": "Customer Satisfaction",
"query": "Updated query for this organization",
"responseType": "CATEGORICAL",
"choices": ["New Option 1", "New Option 2"],
"allowOther": true,
"defaultValue": "New Option 1",
"status": "APPROVED",
"version": 2,
"createdBy": "user@example.com",
"updatedBy": "user@example.com",
"createdDate": 1702834567890,
"updatedDate": 1702834600000
}
]
}
Response and Error Codes
Code | Condition | Description |
|---|---|---|
200 | OK | Fact org mapping updated successfully. |
400 | Bad request | The values provided in the request parameters are invalid. |
401 | Unauthorized | A valid bearer token is required for authorization, or the token doesn’t have the required permission. |
404 | Not Found | Provided fact ID not found. |
500 | Internal Server Error | An unexpected issue occurred on the server side. Retry after some time. |