Create a Question Equivalence Class and Add an Answer

A question equivalence class is a group of equivalent questions. When you have multiple questions with different wording that request the same information, you can combine these questions in a question equivalence class. You also use the question equivalence class to add an answer.

The question equivalence class contains the following information:

To create question equivalence classes, 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.

NOTE:

When you add a question to a question equivalence class, HPE Answer Server automatically updates the question state to answered. You cannot delete a question in this state, and you cannot manually move the question out of this state. You must remove the question from the question equivalence class. See Update a Question Equivalence Class.

You must include the question_id values for the questions that you want to include in the question equivalence class. You can retrieve the question_id values by sending a GetResources action. For example:

http://localhost:7000?Action=GetResources&SystemName=Answerbank&Type=question

You can add multiple question equivalence classes in the same operation, where each question equivalence class is an object in an array.

The following example adds a single question equivalence class that combines two questions, and adds a reference question and an answer. You can also add optional metadata for the answer, such as author information.

Action=ManageResources&SystemName=AnswerBank
data={
   "operation":"add",
   "type":"question_equivalence_class",
   "question_equivalence_classes":[
      {
         "question_ids":[
            "9706856188043740111",
            "8129920660480699726"
         ],
         "rule":{"text":"how AND (regular NEAR2 updates) AND MyCompany"},
         "answer":{
            "text":"Send an email to subscribe@example.com, and we'll add you to our monthly newsletter.",
            "metadata":[
               {"key":"author", "value":"Alex"},
               {"key":"modified_date", "value":"2017-05-05"}
            ]
         },
         "reference_question":"How do I get regular updates about MyCompany?"
      }
   ]
}
NOTE:

Metadata key names can contain alphanumeric characters (a-z, 0-9), period (.), underscore (_) and hyphen (-). They cannot start with a number. It is also best practice to use field names that conform to XML specifications.

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.

You can also use the GetResources action to generate a rule for your question equivalence class. See Generate a Question Equivalence Rule.


_HP_HTML5_bannerTitle.htm