Mrcs

MRC related APIs

Documents Search User Feedback

post

Provide user feedback to the Documents search result.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
answerHashstringRequired

The ID of the Document search result you want to give or cancel feedback for the query. It is created whenever a Documents search happens and bound to the query and the answer pair. It can be retrieved using the Documents API above.

answerstringRequired

The answer that you received to your query from this document.

idstringRequired

The ID for the document where the answer was extracted from.

positiveboolean | nullableOptional

When the value is true, positive feedback is given to the extracted answer for the query. When it's false, negative feedback is given. When it's null, it cancels the feedback.

querystringRequired

The query you want to give or cancel feedback for, toward the extracted search result.

Responses
200

Feedback submitted successfully

application/json
post
POST /webapi/mrc/user_feedback HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 80

{
  "answerHash": "text",
  "answer": "text",
  "id": "text",
  "positive": true,
  "query": "text"
}
200

Feedback submitted successfully

{
  "result": {
    "userFeedback": {
      "positiveCount": 1,
      "negativeCount": 1
    }
  }
}

Documents Feedbacks

get

This API lets you get the list of feedbacks given to Document search results (AI-extracted answers from uploaded documents) for each search query.

Authorizations
Query parameters
offsetintegerOptional

offset allows you to specify the ranking number of the first item on the page.

limitintegerOptional

limit allows you to set the number of objects returned on one page. The maximum value is 100.

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

MRC feedbacks retrieved successfully

application/json
get
GET /webapi/mrc_feedbacks HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

MRC feedbacks retrieved successfully

{
  "result": [
    {
      "query": "text",
      "feedbacks": [
        {
          "document_id": "text",
          "answer": "text",
          "answer_hash": "text",
          "positive": true
        }
      ]
    }
  ],
  "count": 1
}

Documents Search Feedback

post

This API lets you give or cancel feedback given to a Document search result for a search query.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
querystringRequired

The query you want to give or cancel feedback for, toward the extracted search result.

idstringRequired

The ID for the document where the answer was extracted from.

answerHashstringRequired

The ID of the Document search result you want to give or cancel feedback for the query. It is created whenever a Documents search happens and bound to the query and the answer pair. It can be retrieved using the Documents API above.

isPositiveboolean | nullableOptional

When the value is true, positive feedback is given to the extracted answer for the query. When it's false, negative feedback is given. When it's null, it cancels the feedback.

Responses
200

Feedback submitted successfully

application/json
post
POST /webapi/mrc_feedback HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "query": "text",
  "id": "text",
  "answerHash": "text",
  "isPositive": true
}
200

Feedback submitted successfully

{
  "result": {
    "mrcFeedbackSearchResult": {
      "agentFeedback": {
        "positiveCount": 1,
        "negativeCount": 1
      }
    }
  },
  "errors": {}
}

Documents Query History

get

Returns the past Documents Searches that have been done, both through the REST API and the Alli dashboard.

Authorizations
Query parameters
searchTermstringOptional

The term that should have appeared in the query

orderstringOptional

Can either be DESC (meaning latest queries come first), or ASC (meaning earliest queries come first)

endDatestringOptional

The latest date from which you want to get history (dates should be in the form YYYY-MM-DD)

startDatestringOptional

The earliest date from which you want to get history (dates should be in the form YYYY-MM-DD)

limitintegerOptional

A limit on the number of results to show (used for pagination)

offsetintegerOptional

In the list of all results, the index from which to start listing results (used for pagination)

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

Successful response

application/json
get
GET /webapi/mrc_histories HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

Successful response

{
  "result": {
    "histories": [
      {
        "agent": {
          "id": "text"
        },
        "question": "text",
        "answers": [
          {
            "knowledgeBase": {
              "id": "text",
              "fileName": "text"
            },
            "answer": "text",
            "answerHash": "text",
            "answerFormat": "text",
            "hashtags": [
              "text"
            ],
            "feedbackAvailable": true,
            "columnFilterValues": [
              "text"
            ]
          }
        ]
      }
    ],
    "count": 1
  },
  "errors": {}
}

Was this helpful?