Page tree

REST - Ask Question

The EWQuestion operation returns an answer to the question posited in the question Key of the call Body.

  • Returns: a numeric or text answer depending on the nature of the proposed question.
  • Supported Content-Type: application/x-www-form-urlencoded
  • Accepts a URL with URL-encoded parameters and KB data, not record data. For more information about general URL conventions, see REST Interface.
  • This operation supports both GET and POST requests.
  • To use EWQuestion, you must first log in using REST - Login or similar.
This operation is only available in KBs with ConvoAI, with Genius™ powered by Cognizer deployed, and it only returns answers after data has been ingested.


Assume an instance of Agiloft is available on localhost, port 8080, and "Demo" is the KB name.

The following is an example URL for the call:


Required keys include:

question: This is where you enter the actual question, something like "How many contracts include Agiloft?"

requestType: Enter one of the following constants: REGULAR_REQUEST, or NEXT_PAGE_REQUEST or FOLLOW_ON_REQUEST for follow-up questions.

paginationOffset: 0

paginationCount: 3

previousQuestionId: in case of FOLLOW_ON_REQUEST type, you need to specify the previous questionID that was returned in the response body.

paginationQuestionId: in case of NEXT_PAGE_REQUEST type, you need to specify the previous questionID that was returned in the response body. 

The answer to the asked question is found under answer in the return, along with additional information from AI system:

    "success": true,
    "message": "",
    "result": [
            "questionId": "a3b314f2-a5da-4cfd-a234-b95bdc30fb57",
            "userId": "666",
            "orgId": "xxxxxxxxx",
            "question": "How many contracts include Agiloft?",
            "data": [
                    "answerDetail": [
                            "contractMeta": {
                                "names": [],
                                "contractType": "SERVICE AGREEMENT",
                                "parties": [
                                    "Agiloft Inc",
                                    "Maecenas porttitor congue massa",
                                    "Apple Inc"
                                "governingLaw": "California",
                                "startDate": 1514764800000
                            "agiloftData": {
                                "attachmentOriginalTitle": "Generated Draft Contract",
                                "attachmentOriginalDocumentViewerDeepLink": "",
                                "attachmentOriginalId": 118,
                                "attachmentDownloadHotLink": "$genhotlink=XeH2smoQDixxRM4bZzyTqYMKoPWsFSgeejv4u3jPp7c=&$genproject=CAITest2",
                                "userHasAccess": true,
                                "attachmentOriginalRecordDeepLink": ""
                            "contractId": "attachment.attached_file:118"
                    "answer": "I found 32 contracts that match your criteria.",
                    "confidence": 99
            "answerType": "ANSWER",
            "viewAllDocumentsDeepLink": "",
            "totalCount": 32