Batch integration Article brand safety classification

Article brand safety classification

When an article is to be analysed there are two approaches to integration with Mantis.

  1. Mantis synchronous HTTP API endpoint
  2. Mantis Asynchronous Batch File upload and retrieval

These are explained in more detail below.

Mantis Synchronous HTTP API

Call the Mantis ‘classifyArticle’ api endpoint for the customer Mantis account (to be provided) e.g.

https://<publisher-mantis-url>/classifyArticle
  • POST article data in the call to this URL, as a JSON object in the request body including:
    • HTML content (just send the article body content itself, not a whole page with headers/footers/links and teasers for other articles/commercial and other embedded components) – or plain text of the article content.
    • Public Page URL
    • CMS id (publisher specific unique article reference id)
    • Author(s)
    • Title
    • Published/last modified timestamps
  • Pass publisher authentication credentials (to be provided) using an HTTP Basic authentication header

The article will be processed and Brand Safety ratings will be generated – and returned from the Mantis API in the response body as JSON data.

In order to analyse multiple articles at once, the endpoint will accept either a single JSON object describing one file, or an array of objects (one for each file to be processed). If an array of article data objects is passed then the response will also be an array of data objects with ratings for each file.  However, it is important to note that this HTTP API operates synchronously and will have to process all articles before a response is sent . It is therefore only suitable for very small batches of files. If larger batches of files are required to be processed then the asynchronous batch file processing interface should be used (see below).

Mantis Asynchronous Batch File Processing

The data formats used to process larger batches of articles are very similar to those used with the synchronous HTTP API endpoints – containing arrays of JSON data objects describing the files to be processed and the ratings for each processed article.

However, in order to accommodate larger batches, the article data is uploaded as separate files to the Mantis platform.

The primary integration method for file upload uses the IBM Cloud Object Storage. A customer-specific storage bucket will be provisioned and the files containing the article data should be uploaded to this bucket.

Details of how to integrate with the IBM Cloud Object Storage can be found here:

https://cloud.ibm.com/docs/services/cloud-object-storage/hmac?topic=cloud-object-storage-upload

Once the files are uploaded they will be processed by the Mantis analyser and the results will be stored as new files in the same storage bucket – from which they can be downloaded as required.