API Index Manager

API Index Manager

Search Cloud One – Basic
Index Manager API  1.0 

  • Accepts content-type application/json only.
  • Accepts POST requests only.

Authentication

A valid API Key must be passed to IndexManager within the JSON data.

Actions

The IndexManager expects one of three actions:

  • list-index
  • create-index
  • append-metadata-spec-to-index

Action list-index

Lists the Indexes that belong to the account. No additional arguments need to be passed.

Example Request

{
   "APIKey": "ba020ccd-80bc-463c-8b1d-984544c1478a",
   "action": "list-index"
}

Example Response

{
  "success": true,
  "Indexes": [
    {
      "IndexUUID": "6fea98a8-baac-4849-a2dd-e4ca0625a500",
      "IndexID": 12,
      "Name": "Cases",
      "Description": "Ongoing Legal Cases",
      "Size": 4096,
      "FileCount": 1728,
      "Created": "2018-06-06T15:10:46.380Z",
      "Modified": "2018-06-06T15:10:46.381Z"
    },
    {
      "IndexUUID": "6fea98a8-baac-4849-a2dd-e4ca0625a500",
      "IndexID": 15,
      "Name": "Cases",
      "Description": "Ongoing Legal Cases",
      "Size": 6549875324,
      "FileCount": 567901,
      "Created": "2018-06-06T15:10:46.381Z",
      "Modified": "2018-06-06T15:10:46.381Z"
    }
  ]
}

Action create-index

Creates a new Index

Expects namedescription and tech fields to be passed.

  • description may be an empty string
  • tech refers to the desired Index Technology Code. Refer to Index Technologies

Example Request

{
  "APIKey": "ba020ccd-80bc-463c-8b1d-984544c1478a",
  "action": "create-index",
  "name": "Business Letters",
  "description": "Business Letter Templates",
  "tech": 1
}

Example Response

{
  "success": true,
  "IndexUUID": "89c0608b-4b51-4a66-8cbc-64682df7b270"
}

Action append-metadata-spec-to-index

Specify what additional fields, optional and required, should be stored with each document in the index.

Expects the following:

  • IndexUUID The UUID of the Index the specification applies to
  • Fields An array of objects, each containing the following:-
    • Name The name of the field
    • MetaType The type of meta as defined here (TODO)
    • Required whether or not the field is required. File uploads will fail if the field is not passed with the file.
    • DefaultValue if no value is passed, a default value. Default Value is ignored for requiredfields which must always be passed. If blank, assumed none.
    • ExtraParams any extra params as defined here(TODO)

Example Request

{
  "APIKey": "bfa8e6cb-83e1-4511-a4b7-772784bb4818",
  "action": "append-metadata-spec-to-index",
  "IndexUUID": "833fbf0a-2960-44fa-a9a9-ef82665fab36",
  "Fields": [
    {
      "Name": "Date Of Judgement",
      "MetaType": "Date",
      "Required": true,
      "DefaultValue": "",
      "ExtraParams": "TODO ExtraParam for DateRange"
    },
    {
      "Name": "Date Of Ammendment",
      "MetaType": "Date",
      "Required": false,
      "DefaultValue": "",
      "ExtraParams": "TODO"
    },
    {
      "Name": "Case Title",
      "MetaType": "String",
      "Required": true,
      "DefaultValue": "",
      "ExtraParams": ""
    }
  ]
}

Example Response

No JSON Data in Response. Check Response Status Code is 200 OK for success.