Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. URI: /api/v1/search

  2. HTTP Method for the operation: POST

  3. Pass the following as Header to the API:

    1. Content-Type: application/json

    2. ClientType:Ajax

    3. Accept: application/json

    4. Capture the tenant access token retrieved during the Login API call. This Bearer token is sent as the Header to the API. The Bearer token is valid only for 15 mins. So, it should be generated using the Login API and passed to Search API as Header
      Authorization: Bearer: <Tenant Access Token>

  4. Pass the search criteria in Outbound Payload or Request to the Web Service. The request is passed in the following JSON format.

    1. You could use the Artifact ID to search for the Artifact. The request should be in the below format :

      Code Block
      { 
      "id":<ArtifactID>
      }
    2. To search for Artifact based on a user phrase, you can use the following request. Luma Knowledge will generate metadata from the provided user phrase and search for Knowledge artifacts.

      Code Block
      {
      "query": "<search phrase>",
      "domains":[],
      "actions":[],
      "subjects":[],
      "topics":[],
      "motivations":[]
      }
    3. You could also provide additional metadata such as Domains, Topic, Subjects, Actions, Motivation along with the search query to search for relevant Artifacts. Build the request in the following format:

      Code Block
      {
      "query": "<search phrase>",
      "domains":["<domain 1>Government"]
      "actions":[],
      "subjects":["<Subject 1>","<Subject 2>"],
      "topics":[<Topic>],
      "motivations":[]
      }
  5. For a successful search, the web service returns the response in the following format. For every artifact in the result set, you can find information such as artifact name, Summary, Topic, domain, Direct URL etc.

    Code Block
    {
      "errors": null,
      "metaInfo": null,
      "reasonPhrase": null,
      "resultData": {
        "numberOfLevels": 1,
        "levels": [
          {
            "decisionLevel": 0,
            "options": [
              {
                "id": 1,
                "searchStatistics": {
                  "resultScore": 3.0072231,
                  "confidenceScore": 1,
                  "confidenceBand": "HIGH"
                },
                "resultId": "1386",
                "summary": "Fire Development (Construction)",
                "description": "Fire Development (Construction). What Fire Development permits do I need?",
                "optionType": "ARTICLE",
                "parentId": 0,
                "decisionLevel": 0,
                "data": {
                  "topics": [],
                  "providers": [],
                  "domains": [
                    "Government"
                  ],
                  "path": []
                },
                "resultCount": 0,
                "directURL": "http://kmsdevops.automationsaqa1.com/direct/artifact/1386?searchIdentifier=1023-5-1646720607787&kmscontext=2pR7vXuAjTFvSf5%2BwPJGp3XMnOUBKRwLW%2FZpmxXoMsC5qHEUqeQe8nlg6CR1lE4HIsnEh%2BXKa08deMMM4pCYhC6zZBstDzw1EIBLZek8QN5UKHZNk3rK8JZpDR89ztTqOPs5eLc7n%2FN%2BmLkxmqqyPh72siD46udwHs6nV5Xcb%2FR7iaQJ6U3LirijYdRD1IMday8POoyTzzL99T0gPId55OEyatfx4A55S9DGOevLcLu1hyaTvofGRJ7VG5cI0GpYUnOzP5HnoP%2B8%2FdD8CjnAcg%3D%3D"
              }
            ]
          }
        ],
        "tenantId": 1023,
        "subTenantId": 1,
        "numberOfResults": 1,
        "feedbackConfig": {
          "uniqueIdentifier": "1023-5-1646720607787",
          "followupQuestions": {
            "artifact.feedback.followup.question1": "Did the artifact’s topic match the original knowledge request (Yes or No)?",
            "artifact.feedback.followup.question2": "Was the artifact understandable (Yes or No)?",
            "artifact.feedback.question": "Did the artifact answer the user’s question/problem (Yes or No)?"
          }
        }
      },
      "status": "Success",
      "statusCode": 0,
      "statusLine": "Success.",
      "timestamp": 1646720608015,
      "warnings": []
    }