Back Office API (1.1.0)

Download OpenAPI specification:Download

Back Office

This API acts as a create/read/update/delete interface for anything related to documents.

Format

All the request bodies in this API are JSON encoded and their Content-Type headers should be set to application/json.

Auth

The API requires to set the authenticationToken when used with the provided token.

Document

By document, we refer to a cohesive text, for example a complete news article. However, we only require a simple representation for our system to work. Consisting just of a unique ID, a text snippet and optional properties. The text snippet is ideally a short, meaningful representation of the larger document, reduced to just one paragraph.

Id

The document_id is a unique identifier for a single document. We don't require a specific format, it just needs to comply to the following regexp: ^[a-zA-Z0-9_:@.-]+$.

Snippet

A snippet is a reduced representation of a larger text, for example if the document would be a news article, then its text would be the news article in a pure textual format. In order for our system to work correctly, it is important that the snippet is just the size of one or two paragraphs, and that the snippet's text clearly summarises the larger text. For example, let's take a news article which talks about the effects of inflation. Our snippet could then be: "Inflation worries as prices keep rising. People having budgetary difficulties as a result. Government pressured to take action.". A bad snippet would for example be just taking the very first paragraph of a document, which could sometimes work, but could also lead to: "December 20th 2020. Article written by Jane Doe. On this bright and sunny day, people might forget about their worries sometimes."

Properties

Properties are optional entries for documents, which are usually needed to properly show the document back to the user, when it returns as a personalized document. If for example, you'd wish to integrate a type of carousel view, listing a total of 10 personalized documents in a "for you"-section, then you might choose to display each document as an image and title, with a url to link the user to when pressed. For this, you would need three document properties: image, link and title. You are free to add as many properties as needed. \

Authentication

ApiKeyAuth

Security Scheme Type API Key
Header parameter name: authorizationToken

back office

System management, including documents and properties.

Add documents to the system

Add documents to the system.

The system will create a representation of the document that will be used to match it against the preferences of a user.

Important note: Currently we allow up to a maximum of 100 documents per batch size. If you need to add more, then please split up the total amount of documents in separate calls, where each call contains at maximum 100 documents.

Important note: If a document id appears multiple times, only the last document with that id is retained.

Important note: Documents which have no publication_date are not included when using the published_after filter.

Authorizations:
Request Body schema: application/json
required
Array of objects (IngestedDocument) [ 1 .. 100 ] items

Responses

Request samples

Content type
application/json
{
  • "documents": [
    ]
}

Response samples

Content type
application/json
{ }

Delete all listed documents.

Delete all documents listed in the request body.

Authorizations:
Request Body schema: application/json
documents
required
Array of strings [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "documents": [
    ]
}

Response samples

Content type
application/json
{
  • "request_id": "string",
  • "kind": "string",
  • "details": { }
}

Get the documents considered for recommendations. Deprecated

Get the documents considered for recommendations.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "documents": [
    ]
}

Set the documents considered for recommendations. Deprecated

Set the documents considered for recommendations.

Authorizations:
Request Body schema: application/json
required
Array of objects (DocumentCandidate) >= 0 items

Responses

Request samples

Content type
application/json
{
  • "documents": [
    ]
}

Response samples

Content type
application/json
{
  • "request_id": "string",
  • "kind": "string",
  • "details": { }
}

Delete the document from the system.

Permanently deletes the document from the system.

Authorizations:
path Parameters
document_id
required
string [ 1 .. 256 ] characters ^[a-zA-Z0-9_:@.\-]+$
Example: document_id

Id of the document

Responses

Response samples

Content type
application/json
{
  • "request_id": "string",
  • "kind": "string",
  • "details": { }
}

Get all document properties

Gets all the properties of the document.

Authorizations:
path Parameters
document_id
required
string [ 1 .. 256 ] characters ^[a-zA-Z0-9_:@.\-]+$
Example: document_id

Id of the document

Responses

Response samples

Content type
application/json
{
  • "properties": {
    }
}

Set all document properties

Sets or replaces all the properties of the document.

Authorizations:
path Parameters
document_id
required
string [ 1 .. 256 ] characters ^[a-zA-Z0-9_:@.\-]+$
Example: document_id

Id of the document

Request Body schema: application/json
required
object

Mostly arbitrary properties that can be attached to a document. A key must be a valid DocumentPropertyId.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "request_id": "string",
  • "kind": "string",
  • "details": { }
}

Delete all document properties

Deletes all the properties of the document.

Authorizations:
path Parameters
document_id
required
string [ 1 .. 256 ] characters ^[a-zA-Z0-9_:@.\-]+$
Example: document_id

Id of the document

Responses

Response samples

Content type
application/json
{
  • "request_id": "string",
  • "kind": "string",
  • "details": { }
}

Get a document property

Gets the property of the document.

Authorizations: