Versions Compared

Key

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

This contract is currently in the Proof-of-concept stage and is still subject to change

Introduction

Our product can integrate with a variety of tools that offer additional insights into your object. By configuring new Module Plugins with the category “Insights”, MediaHaven will produce a list of reports by combining all reports across all plugins of this category.

...

Configuration

The module plugin can be configured with the following custom property called “Fields” which is a JSON object with as key the insight ID and as value the dotted key of the Metadata Fields to store the insight’s data in.

Expand
titleExample custom properties
Code Block
  {
    "Config": {
      "SUMMARY": "Dynamic.PocInsights.Summary",
      "ENTITIES_PERSONS": "Dynamic.PocInsights.Persons.Person",
      "ENTITIES_ORGANISATIONS": "Dynamic.PocInsights.Organisations.Organisation",
      "ENTITIES_LOCATIONS": "Dynamic.PocInsights.Locations.Location",
      "ENTITIES_GENERAL": "Dynamic.PocInsights.GeneralItems.Item",
      "ACTIONS": "Dynamic.PocInsights.Actions.Action",
      "OCR": "Dynamic.PocOcr",
    }
  }

API

Common

For all methods the following HTTP header is provided:

Code Block
x-api-key: <API key for the downstream service>

POST /analyze

Analyzes the object such that insights can be requested for this object when the analysis is completed. The method is asynchronous, meaning it does not need to wait to return until the analysis is completed.

Input

The input is a JSON body with the following properties

Property

Type

Description

Metadata

Object

The standard JSON representation of the metadata as used in the MediaHaven REST API

.

: MediaHaven sidecar format

Config

Object

The custom properties configured on the plugin

, as described above: https://mediahaven.atlassian.net/wiki/spaces/CS/pages/

4438884395

4652335133/

Module+Plugins#Custom-properties

Insights+Connector+Contract#Configuration

Response / Output

  • The HTTP response 202 Accepted when the analysis was successfully started

Example

Expand
titleInput
Code Block
languagejson
{
  "Config": {
    "SUMMARY": "Dynamic.PocInsights.Summary",
    "ENTITIES_PERSONS": "Dynamic.PocInsights.Persons.Person",
    "ENTITIES_ORGANISATIONS": "Dynamic.PocInsights.Organisations.Organisation",
    "ENTITIES_LOCATIONS": "Dynamic.PocInsights.Locations.Location",
    "CustomPropertyA" : "example"ENTITIES_GENERAL": "Dynamic.PocInsights.GeneralItems.Item",
    "ACTIONS": "Dynamic.PocInsights.Actions.Action",
    "OCR": "Dynamic.PocOcr",
  },
  "Metadata": {
    "Descriptive": {
        "Title": "My object",
        ...
    }
  }
}

...

POST insights/

Returns the list of available insights on the object without returning the detail of each insight.

Input

The input uses the following HTTP parameters

...

JSON properties

Property

Type

Description

recordIdRecordId

String

The record ID of the object in question<mapping>

IncludeRawData

Boolean

Whether to include the raw data, by default false.

Config

Object

The custom properties configured on the plugin are passed as a sequence of parameters → , as described above: https://mediahaven.atlassian.net/wiki/spaces/CS/pages/44388843954652335133/Module+Plugins#Custom-propertiesInsights+Connector+Contract#Configuration

Response / Output

  • 200 OK with the response

  • 409 Conflict when the analysis is still pending

  • The output is a JSON array of JSON objects with the following properties

Property

Type

Description

Name

String

The name of the insight

Id

Metadata

The standard JSON representation of the metadata as used in the MediaHaven REST API: MediaHaven sidecar format.

The generated insights, converted into metadata as instructed by the provided configuration.

RawData

String

The

ID of the insight such that it can be requested indivudually

full raw data of the analysis; as a base64 encoded string.

Example

Expand
titleInput & Output

Input

Code Block
languagejson
[{
  "Config": {
    "SUMMARY": "Dynamic.PocInsights.Summary",
"Name    "ENTITIES_PERSONS": "SummaryDynamic.PocInsights.Persons.Person",
    "ENTITIES_ORGANISATIONS": "Dynamic.PocInsights.Organisations.Organisation",
    "IdENTITIES_LOCATIONS": "SUMMARIES"Dynamic.PocInsights.Locations.Location",
   }  "ENTITIES_GENERAL": "Dynamic.PocInsights.GeneralItems.Item",
   { "ACTIONS": "Dynamic.PocInsights.Actions.Action",
    "NameOCR": "Word cloudDynamic.PocOcr",
   },
  "IdRecordId": "WORD_CLOUD"<your Record ID>",
  "IncludeRawData": }
]

GET insights/{ID}

Returns the details of a particular insight including the raw data.

Input

  • The insight ID is specified as a path variable.

  • The input uses the following HTTP parameters

...

Parameter

...

Description

...

recordId

...

The record ID of the object in question

...

<mapping>

...

The custom properties configured on the plugin are passed as a sequence of parameters → https://mediahaven.atlassian.net/wiki/spaces/CS/pages/4438884395/Module+Plugins#Custom-properties

Response / Output

  • 200 OK with the response

  • 409 Conflict when the analysis is still pending

  • The output is a JSON object with the following properties

...

Property

...

Type

...

Description

...

Name

...

String

...

The name of the insight

...

Id

...

String

...

The ID of the insight such that it can be requested indivudually.

...

Data

...

String

...

The data of this particular insight

Example

Expand
titleOutput
Code Block
languagejson
{
  "Name": "Word cloud",
  "Id": "WORD_CLOUD",
  "Data": "<your data>"true
}

Output

Code Block
languagejson

{
  "Metadata":  {
    "Dynamic": {
      "InsightsPoc": {
        "Summary": "This is the summary of your document...",
        "EntitiesOrganisations": {
          "Organisation": ["The European Parliament", "Zeticon", ...]
        },
        "EntitiesLocations": {
          "Location": ["The European Parliament", "Zeticon", ...]
        },
        "EntitiesOrganisations": {
          "Organisation": ["The European Parliament", "Zeticon", ...]
        },
        "EntitiesLocations": {
          "Location": ["Gent", "Antwerp", ...]
        },
        "EntitiesGeneralItems": {
          "Item": ["Document", "Paper", ...]
        },
        "Actions": {
          "Action": ["voorstellen", "afwerken", ...]
        }
      }
    }
  },
  "RawData": <RAW DATA>
}