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 business intelligence (commonly called BI) toolstools that offer additional insights into your object. By configuring new Module Plugins with the category “Business Intelligence”“Insights”, MediaHaven will produce a list of reports by combining all reports across all plugins of this category.

Methods

A connector of the category “Business Intelligence” must implement the following methods

GET /reports

Returns a list of embeddable report URLs. This means those URLs can be safely embedded into a 3rd party website, specifically the MediaHaven frontend. If the BI tool wants to protect itself against tampering of the URL by the end-user (e.g. changing a parameter), then the connector should produce a signed URL which is inherently tamper-proof.

Optional parameters

Depending on the application and the authorizations of the user the following parameters can provided with this GET request.

...

Parameter

...

Usage

...

Example

...

collection

...

When the installation contains multiple applications, then the collection parameter specifies which application it concerns such that a different list of reports can be returned.

...

Seriesregister, e-Depot

...

  • filter.organisation_long_name

  • filter.organisation_short_name

  • filter.organisation_id

...

When the user has no access across all organisations, then these parameters restrict the results that should be displayed in the report to this organisation. Specifically, if the user has the function ADMIN_VIEW_ALL_ORGANISATIONSthen they can see installation-wide reports.

...

The organisation of the user

...

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 <reportingfor enginethe api key>

...

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/4652335133/Insights+Connector+Contract#Configuration

Response / Output

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

Example

Expand
titleExampleInput
Code Block
languagejson
[{
  "Config": {
    "EmbedUrlSUMMARY": "https://mh-dev.mediahaven.com/reporting/embed/dashboard/ABC#bordered=true&titled=trueDynamic.PocInsights.Summary",
    "IdENTITIES_PERSONS": 123"Dynamic.PocInsights.Persons.Person",
    "LabelENTITIES_ORGANISATIONS": "My report ADynamic.PocInsights.Organisations.Organisation",
    "ENTITIES_LOCATIONS": "Dynamic.PocInsights.Locations.Location",
    "CollectionENTITIES_GENERAL": "CollectionDynamic.PocInsights.GeneralItems.Item",
    "ParamsACTIONS": ["Dynamic.PocInsights.Actions.Action",
    "OCR": "Dynamic.PocOcr",
  {},
  "Metadata": {
    "IdDescriptive": 123,{
        "LabelTitle": "labelMy object",
        "Type": "Type"...
    }
  }
}

POST insights/

Returns the list of available insights on the object

Input

The input uses the following JSON properties

Property

Type

Description

RecordId

String

The record ID of the object in question

IncludeRawData

Boolean

Whether to include the raw data, by default false.

Config

Object

The custom properties configured on the plugin, as described above: https://mediahaven.atlassian.net/wiki/spaces/CS/pages/4652335133/Insights+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

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 full raw data of the analysis; as a base64 encoded string.

Example

Expand
titleInput & Output

Input

Code Block
languagejson
{
  "Config": {
    "SUMMARY":  }"Dynamic.PocInsights.Summary",
     ]"ENTITIES_PERSONS": "Dynamic.PocInsights.Persons.Person",
  },   {"ENTITIES_ORGANISATIONS": "Dynamic.PocInsights.Organisations.Organisation",
    "EmbedUrlENTITIES_LOCATIONS": "https://mh-dev.mediahaven.com/reporting/embed/dashboard/XYZ#bordered=true&titled=trueDynamic.PocInsights.Locations.Location",
    "IdENTITIES_GENERAL": 124"Dynamic.PocInsights.GeneralItems.Item",
    "LabelACTIONS": "My report B",
 "Dynamic.PocInsights.Actions.Action",
    "OCR": "Dynamic.PocOcr",
  },
  "CollectionRecordId": "Collection<your Record ID>",
  "IncludeRawData": true
"Params": [}

Output

Code Block
languagejson

{
  "Metadata":  {
    "Dynamic": {
      "InsightsPoc": {
        "IdSummary": 124 "This is the summary of your document...",
        "LabelEntitiesOrganisations": "label", {
          "TypeOrganisation": ["The European Parliament"Type", "Zeticon", ...]
        },
    ]   }
]

GET /reports/:id

Returns a specific report with the ID

Optional parameters

Same as the general GET method.

Expected headers

Code Block
x-api-key: <reporting engine api key>

Output

Expand
titleExample
Code Block
languagejson
{ "EntitiesLocations": {
          "EmbedUrlLocation": "https://mh-dev.mediahaven.com/reporting/embed/dashboard/ABC#bordered=true&titled=true",
  "Id": 123,
  "Label": "My report A",
  "Collection": "Collection",
  "Params": [
    { ["The European Parliament", "Zeticon", ...]
        },
        "EntitiesOrganisations": {
          "Organisation": ["The European Parliament", "Zeticon", ...]
        },
        "EntitiesLocations": {
          "Location": ["Gent", "Antwerp", ...]
        },
        "IdEntitiesGeneralItems": 123,{
          "LabelItem": ["Document", "labelPaper", ...]
        },
  "Type": "Type"      "Actions": {
          "Action": ["voorstellen", "afwerken", ...]
        }
     ] }
    }
  },
  "RawData": <RAW DATA>
}