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 still subject to change

Introduction

To expose Reporting services to our system, we need an API to be exposed for the MediaHaven installation. When creating new Module Plugins having of the following https://mediahaven.atlassian.net/wiki/spaces/CS/pages/edit-v2/4438884395#Categories

  • Business Intelligence

then MediaHaven will connect to this plugin using REST API calls, which must implement the following methods depending on the category.

Methods

GET /config-rules
Status
colourBlue
titleALL CATEGORIES

It gives the possible configuration parameters for this connector

Ex.

Code Block
languagejson
{
  "Rules": [
    {
      "Name": "TextModel",
      "Type": "String|Integer|Boolean",
      "Required": false,
      "Default" : "ada2"
    }
  ]
}

POST /text-embedding
Status
colourBlue
titleEMBEDDING

Expected parameters

Text as JSON body in Textproperty and Config based on config rules

Ex.

Code Block
languagejson
{
  "Text": "Given me pictures of lamas",
  "Dimensions": 1536,
  "Config": {
    "TextModel" : "ada2"
  }
}

Expected headers

Code Block
x-api-key: <optional api key>

Output

Array of float (vector) with size equal to dimensions. The vector MUST BE normalized. When the provided dimensions are 0, the embedding should be in the natural dimensions used by the embedding. If the embeddings cannot be provided in the requested dimensions, then a 400 HTTP error code should be returned.

Ex.

Code Block
languagejson
{
  "Embedding": [ 
    -0.006929283495992422,
    -0.005336422007530928,
    ... (omitted for spacing)
    -4.547132266452536e-05,
    -0.024047505110502243]
}

POST /embedding
Status
colourBlue
titleEMBEDDING

Expected parameters

Record as JSON body in Metadata property and Config based on config rules

Ex.

Code Block
languagejson
{
  "Config": {
    "TextModel" : "ada2"
  },
  "Metadata": {
    "RightsManagement": {
        "Permissions": {...},
        "RecordPhase": "Concept",
        "ExpiryDate": null,
        "ExpiryStatus": null,
        "Zone": {}
    },
    "Dimensions": 1536
  }
}

Expected headers

Code Block
x-api-key: <optional api key>

Output

Array of float (vector) with size equal to dimensions. The vector MUST BE normalized. When the provided dimensions are 0, the embedding should be in the natural dimensions used by the embedding. If the embeddings cannot be provided in the requested dimensions, then a 400 HTTP error code should be returned.

Ex.

Code Block
languagejson
{
  "Embedding": [ 
    -0.006929283495992422,
    -0.005336422007530928,
    ... (omitted for spacing)
    -4.547132266452536e-05,
    -0.024047505110502243]
}

POST /describe
POST /generative-metadata/description
Status
colourBlue
titleGENERATIVE

Expected parameters

Record as JSON body in Metadata property and Config based on config rules

Ex.

...

languagejson

...

part of version 25.1

Introduction

Our product can integrate with a variety of business intelligence (commonly called BI) tools. By configuring new Module Plugins with the category “Business Intelligence”, 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 be 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

  • layout.border

  • layout.title

Changing the layout of the embedding setting them to true or false will display or hide the corresponding item in the embedded. By default all of them are false

Expected headers

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

Output

Expand
titleExample
Code Block
languagejson
[
  {
    "EmbedUrl": "https://mh-dev.mediahaven.com/reporting/embed/dashboard/ABC#bordered=true&titled=true",
    "Id": 123,
    "Label": "My report A",
    "Collection": "Collection",
    "Params": [
      {
        "Id": 123,
        "Label": "label",
        "Type": "Type"
      }
    ]
  },
  {
    "EmbedUrl": "https://mh-dev.mediahaven.com/reporting/embed/dashboard/XYZ#bordered=true&titled=true",
    "Id": 124,
    "Label": "My report B",
    "Collection": "Collection",
    "Params": [
      {
        "
RecordPhase
Id": 
"Concept"
124,
        "
ExpiryDate
Label": 
null
"label",
        "
ExpiryStatus
Type": 
null,
"Type"
      
"Zone": {
}
    
}
]
  }
}
]

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: <optional<reporting engine api key>

Output

Textual string

...

Expand
titleExample
Code Block
languagejson
{
  "
Description
EmbedUrl": "
This is an image of a cat" }

POST /generative-metadata
Status
colourBlue
titleGENERATIVE

Record as JSON body in Metadata property, Fields with as items dotted keys and AI hint as value, Locale as the requested target locale for the output and finally Config based on config rules

Ex.

Code Block
languagejson
{ "Fields": { "Descriptive.Description": { "Hint": "Give a description for the image" }, "Descriptive.Keywords.Keyword": { "Hint": "Give a list of keywords. Generate around 10.", "Type": "array" } }, "Locale": "en_US", "Config": { "TextModel" : "ada2" }, "Metadata": { "RightsManagement": {
https://mh-dev.mediahaven.com/reporting/embed/dashboard/ABC#bordered=true&titled=true",
  "Id": 123,
  "Label": "My report A",
  "Collection": "Collection",
  "Params": [
    {
      "
Permissions
Id": 
{...}
123,
      
"
RecordPhase
Label": "
Concept
label",
      
"
ExpiryDate
Type":
null,
 
"
ExpiryStatus": null, "Zone": {} }
Type"
   
}
 }

Expected headers

Code Block
x-api-key: <optional api key>

Output

A JSON object of generated fields with as keys dotted keys and as value the AI's generated value.

Ex:

Code Block
languagejson
{

  
"GeneratedFields": { "Descriptive.Description": "This is an image of a cat", "Descriptive.Keywords.Keyword": ["Animal", "Cat", ...
]
}

}