Skip to content

Data Format

Providing data must be done in a specific format, regardless of which method you choose to generate the content. If you provide the Search and Data endpoints, the Data endpoint must provide the data in this format. Similarly if you use the POST endpoint for generating the content, you must provide your data in the body of the request, in this format. The data is provided in as a list of Variables in a json object as follows:

{
    "Variables": [
        { ..variable 1.. },
        { ..variable 2.. },
        ..etc.,
    ]
}

Variables are pretty straight forward; they have a Type, a Name, a Value, and an optional Description.

Metadata

It is possible to include some metadata, which will be passed on when generating content. To do so, include the metadata as follows:

{
    "Metadata": (insert any valid json object here),
    "Variables": [.. your variables..]
}

The metadata will then be included in the response of the generation endpoint, as a property named Metadata.

Variable Types

The platform supports variables of type Text, Number, Date, List and Bool.

Text

A text variable contains basic text.

{
    "Type": "Text",
    "Name": "Hometeamname",
    "Description": "Name of the home team",
    "Value": "Barcelona"
}

Number

Contains a number in the form of a decimal (any number you write will be treated as a decimal).

{
    "Type": "Number",
    "Name": "Hometeamgoals",
    "Description": "Amount of hometeam goals",
    "Value": 3
}

Date

A DateTime of the format yyyy-MM-ddTHH:mm:ss.

{
    "Type": "Date",
    "Name": "Matchdate",
    "Description": "Date of the match",
    "Value": "2020-01-01T18:00:00"
}

List

Contains a json-array of Text.

{
    "Type": "List",
    "Name": "Goalscorers",
    "Description": "Players who scored a goal",
    "Value": ["Lional Messi", "Ansu Fati", "Eden Hazard"]
}

Note that the templating language allows you to do operations on your data, so on lists you can do things such as count the number of items, format the items in a specific way, or do set-operations such as union or intersect, which means you often dont need to supply specific variables such as "amount of goalscorers" or "Goalscorer first names". These can be handled by the templating language.

Bool

Contains a boolean value (true/false).

{
    "Type": "Bool",
    "Name": "Hometeamwin",
    "Description": "Whether the hometeam won",
    "Value": false,
}

Variable Names

To organize your variables when using the editor, we will treat underscores (_) as groupings. This means that if you specify the name teams_hometeam_name, this will group all variables that start with teams, then all that start with hometeam, and finally the last part of the name will be treated as the name of the variable.

Note that internally all names of variables start with { and end with }, but you do not have to add that in your naming, as we will add it for you.

Supported characters beside underscores are letters, numbers, and dashes (-).