Skip to end of banner
Go to start of banner

Insights Connector Contract

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

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.

 Example custom properties
{
  "Fields": {
    "Summary": "Dynamic.InsightsPoc.Summary",
    "Entities": "Dynamic.InsightsPoc.Entities",
    "Actions": "Dynamic.InsighstPoc.Actions"
    "Ocr": "Dynamic.InsightsPoc.Ocr"
  }
}

API

Common

For all methods the following HTTP header is provided:

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

Description

Metadata

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

Config

The custom properties configured on the plugin → https://mediahaven.atlassian.net/wiki/spaces/CS/pages/4438884395/Module+Plugins#Custom-properties

Response / Output

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

Example

 Input
{
  "Config": {
    "CustomPropertyA" : "example"
  },
  "Metadata": {
    "Descriptive": {
        "Title": "My object",
        ...
    }
  }
}

GET insights

Returns the list of available insights on the object

Input

The input uses the following HTTP parameters

Parameter

Description

recordId

The record ID of the object in question

includeRawData

Whether to include the raw data, by default false.

<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 array of JSON objects with the following properties

Property

Subproperty

Type

Description

Insights

Array

Insights

Name

String

The name of the insight

Insights

Id

String

The ID of the insight

Insights

Value

Array | String

The data as a string or an array of strings

RawData

String

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

Example

 Output
{
  "Insights": [
    {
      "Name": "Summary",
      "Id": "SUMMARY",
      "Value": "This is the summary of your document..."
   },
   {
      "Name": "EntitiesOrganisations",
      "Id": "ENTITIES_ORG",
      "Value": ["The European Parliament", "Zeticon", ...]
   },
   {
      "Name": "EntitiesLocations",
      "Id": "ENTITIES_LOC",
      "Value": ["Gent", "Antwerp", ...]
   },
   {
      "Name": "EntitiesPerson",
      "Id": "ENTITIES_PERSON",
      "Value": ["Alice", "Bob", ...]
   },
   {
      "Name": "EntitiesGeneral",
      "Id": "ENTITIES_MISC",
      "Value": ["Document", "Paper", ...]
   },
    {
    "Name": "Actions",
    "Id": "ACTIONS",
    "Value": ["voorstellen", "afwerken", ...]
   }
  ],
  "RawData": <RAW DATA>
}
  • No labels