Update a Question Equivalence Class
You can update the following properties in your question equivalence classes:
-
the list of question IDs that the question equivalence class contains.
-
the answer to the reference question.
-
the question equivalence rule.
-
the text of the reference question. In general, OpenText recommends you use this update to correct spelling mistakes only. If you want to completely change the reference question, create a new question equivalence class with a new ID.
To update a question equivalence class, you use a ManageResources
action in a POST request method, with the information about the questions provided in the Data
parameter as a JSON object.
The update
operation replaces existing content with the new version that you provide. If you omit a value, Answer Server keeps the existing value. If you want to delete the existing value, you can explicitly set an empty value or array.
For example, if you change the list of question IDs, but do not set the answer block in your JSON data, Answer Server updates the list of questions, but does not modify the answer.
The amend
operation allows you to add questions to the question equivalence class. In this case, you provide only the questions that you want to add to the question equivalence class, rather than the complete list of question IDs. You can use this option if you might have multiple users adding equivalent questions at the same time, to ensure that all changes are reflected.
NOTE: When you add questions to a question equivalence class, Answer Server automatically updates the question state to answered
. If you remove all questions from the question equivalence class, it reverts the question state to incoming
.
The following example updates the question equivalence class with ID 2012912839742797651 with a new list of question_ids
. It does not update the stored answer for the question (if it exists).
Action=ManageResource&SystemName=AnswerBank data={ "operation":"update", "type":"question_equivalence_class", "question_equivalence_class":{ "id": 2012912839742797651, "question_ids":[ "9706856188043740111", "8129920660480699726", "3067998369792637739" ], "reference_question":"How do I get regular updates about MyCompany?", "rule": "updates AND MyCompany" } }
You can retrieve the full schema for the JSON object to use by using the GetResources
action. See Find the JSON Schema for Your Update.
NOTE: The ManageResources
action fails if you attempt to use request JSON that contains properties that are not contained in the appropriate schema.
TIP: Typically, OpenText recommends that you send ManageResources
as a POST request. For testing, you can use a GET request, in which case you must base64 encode the JSON data.
You can also use the GetResources
action to generate a rule for your question equivalence class. See Generate a Question Equivalence Rule.