Layouts
As a plugin developer, you customize the new/edit plugin instance screens with a layout JSON file. You can group properties into categories and choose the type of field representing each of them.
A plugin layout is bound to a plugin version.
It is optional, except for audience segment feeds. A default layout is used to show all properties of a plugin version (Note that there is no layout file associated to this default layout).
A plugin layout is composed of:
  1. 1.
    A layout JSON file
  2. 2.
    A non-empty list of translation CSV files

Layout JSON file

This file declares the different elements of the configuration UI.

Example

1
{
2
"version": "V202005",
3
"sections": [
4
{
5
"title": "{{section_title}}",
6
"sub_title": "{{section_subtitle}}",
7
"fields": [
8
{
9
"property_technical_name": "property_1",
10
"field_type": "INPUT",
11
"label": "{{property_1_label}}",
12
"tooltip": "{{property_1_tooltip}}",
13
"required": true
14
},
15
{
16
"property_technical_name": "property_2",
17
"field_type": "MULTI_SELECT",
18
"label": "{{property_2_label}}",
19
"tooltip": "{{property_2_tooltip}}",
20
"enum": [
21
{
22
"value": "COOKIE",
23
"label": "{{COOKIE_label}}"
24
},
25
{
26
"value": "CUSTOMER",
27
"label": "{{CUSTOMER_label}}"
28
},
29
{
30
"value": "IDFA",
31
"label": "{{IDFA_label}}"
32
},
33
{
34
"value": "AD_ID",
35
"label": "{{AD_ID_label}}"
36
}
37
],
38
"required": true
39
}
40
],
41
"advanced_fields": [
42
{
43
"property_technical_name": "segment_name",
44
"field_type": "INPUT",
45
"label": "{{segment_name_label}}",
46
"tooltip": "{{segment_name_tooltip}}",
47
"required": false
48
},
49
{
50
"property_technical_name": "segment_description",
51
"field_type": "INPUT",
52
"label": "{{segment_description_label}}",
53
"tooltip": "{{segment_description_tooltip}}",
54
"required": false
55
},
56
{
57
"property_technical_name": "customer_user_identifier",
58
"field_type": "INPUT",
59
"label": "{{customer_user_identifier_label}}",
60
"tooltip": "{{customer_user_identifier_tooltip}}",
61
"required": false
62
},
63
{
64
"property_technical_name": "continent",
65
"field_type": "SELECT",
66
"label": "{{continent_label}}",
67
"tooltip": "{{continent_tooltip}}",
68
"enum": [
69
{
70
"value": "NAM",
71
"label": "NAM"
72
},
73
{
74
"value": "EMEA",
75
"label": "EMEA"
76
},
77
{
78
"value": "APAC",
79
"label": "APAC"
80
}
81
],
82
"required": false
83
}
84
]
85
}
86
],
87
"metadata": {
88
"large_icon_asset_id": "13636",
89
"small_icon_asset_id": "13636",
90
"display_name": "{{section_title}",
91
"description": "{{section_subtitle}}"
92
}
93
}
Copied!

Schema

Here is the JSON schema. You can validate your files with it in your favorite JSON validation tool.
1
{
2
"$schema": "http://json-schema.org/schema#",
3
"definitions": {
4
"PluginLayoutMetadataResource": {
5
"type": "object",
6
"properties": {
7
"large_icon_asset_id": {"type": "string"},
8
"small_icon_asset_id": {"type": "string"},
9
"large_icon_asset_url": {"type": ["string", "null"]},
10
"small_icon_asset_url": {"type": ["string", "null"]},
11
"tooltip": {"type": ["string", "null"]},
12
"display_name": {"type": "string"},
13
"description": {"type": "string"}
14
},
15
"required": ["large_icon_asset_id", "small_icon_asset_id", "display_name", "description"]
16
},
17
"PluginLayoutEnumResource": {
18
"type": "object",
19
"properties": {
20
"value": {"type": "string"},
21
"label": {"type": "string"}
22
},
23
"required": ["value", "label"]
24
},
25
"PluginLayoutFieldResource": {
26
"type": "object",
27
"properties": {
28
"property_technical_name": {"type": "string"},
29
"field_type": {"type": "string"},
30
"label": {"type": "string"},
31
"tooltip": {"type": ["string", "null"]},
32
"enum": {"type": ["array", "null"],
33
"items": {
34
"$ref": "#/definitions/PluginLayoutEnumResource"
35
}
36
},
37
"max_length": {"type": ["integer", "null"]},
38
"required": {"type": ["boolean", "null"]}
39
},
40
"required": ["property_technical_name", "field_type", "label"]
41
},
42
"PluginLayoutSectionResource": {
43
"type": "object",
44
"properties": {
45
"title": {"type": "string"},
46
"sub_title": {"type": "string"},
47
"fields": {"type": "array",
48
"items": {
49
"$ref": "#/definitions/PluginLayoutFieldResource"
50
}
51
},
52
"advanced_fields": {"type": "array",
53
"items": {
54
"$ref": "#/definitions/PluginLayoutFieldResource"
55
}
56
}
57
},
58
"required": ["title", "sub_title", "fields", "advanced_fields"]
59
}
60
},
61
62
"type": "object",
63
"properties": {
64
"version": {"type": "string"},
65
"sections": {"type": "array",
66
"items": {
67
"$ref": "#/definitions/PluginLayoutSectionResource"
68
}
69
},
70
"metadata": {"$ref": "#/definitions/PluginLayoutMetadataResource"}
71
},
72
"required": ["version", "sections", "metadata"]
73
}
Copied!

Root

Attribute
Type
Description
version
a string
the version of the layout
sections
a list of Sections
it defines the form's sections (see below for the Definition)
metadata
a Metadata resource
it defines metadata concerning the form (see below for the Definition)

Sections

Attribute
Type
Description
title
a string
the section title
sub_title
a string
the section subtitle
fields
a list of Fields
it defines the fields of the section (see below for the Definition)
advanced_fields
a list of Fields
it defines the advanced fields of the section, which can be graphically expanded or not (see below for the Definition)

Fields

Attribute
Type
Description
property_technical_name
a string
the technical name of the property represented by the field
field_type
a field type string enum
the type of the input form field (see below for the Definition)
label
a string
the label preceding the field type, on its left in the form
tooltip
a string (optional)
the help text displayed in the tooltip following the field type, on its right in the form
enum
a list of Enum resources (optional)
an enum describing the possible values of the field (used by some field types : SELECT, MULTI_SELECT, SWITCH, RADIO, CHECKBOX) (see below for the Definition)
max_length
an integer (optional)
a maximum length of the text in the field type; used only in the case TEXTAREA
required
a boolean (optional)
it defines whether the field is mandatory or not; if the value is not specified, then it isn't (the default value is false)
The possible field types are the following:
  • TEXTAREA
  • URL
  • DATA_FILE
  • HTML
  • NUMBER
  • SELECT
  • MULTI_SELECT
  • IMAGE
  • INPUT
  • INPUT_NUMBER
  • SWITCH
  • RADIO
  • CHECKBOX
  • DATE
  • DATE_RANGE

Enum

Attribute
Type
Description
value
a string
the value of the enum, which will be affected to the property
label
a string
the label of the enum, which will be displayed in the field

Metadata

Attribute
Type
Description
large_icon_asset_id
an integer
the asset id of the large icon representing the plugin layout
small_icon_asset_id
an integer
the asset id of the small icon representing the plugin layout
display_name
a string
the plugin version's name (visible in the plugin listing and the form page)
description
a string
a description of the plugin version (visible in the plugin listing and the form page)
Note that the assets must belong to the same organisation than the plugin.

Translation files

Translation csv files are used to support localization. Given a layout json file, for each locale, a translation csv file can be provided. The plugin developer can refer to a value in the layout json file by surrounding the value name with double curly brackets (hence, referring to value val is done with {{val}} in the json file). Those values can be found anywhere in the layout json file. For example, an excerpt of a layout json file, referring to the value val when defining a label in a field, looks like:
1
{
2
"property_technical_name":"name",
3
"field_type":"TEXTAREA",
4
"label":"{{val}}"
5
}
Copied!
A translation csv is composed of two comma-separated columns. The header of the table is KEY,VALUE. The first column corresponds to the keys, i.e the names of the values (val in the preceding example). The second column corresponds to the values by which the keys will be replaced when the layout will be displayed in Navigator.Considering the previous excerpt of a layout json file, a (brief) corresponding US English (en-US locale) translation csv file could be:
1
KEY,VALUE
2
val,"Hello World!"
Copied!
Here is a sample translation file associated with the sample layout.json file in this page
1
KEY,VALUE
2
section_title,"Beeswax Audience Feed"
3
section_subtitle,"Synchronize audiences with Beeswax"
4
buzz_key_label,"Buzz key"
5
buzz_key_tooltip,"Your buzz key as provided by Beeswax. Warning : valid credentials should be set into mediarithmics for this buzz key. If an authentication error is displayed when saving, contact your account manager."
6
identifiers_to_send_label,"Types of user identifiers sent"
7
identifiers_to_send_tooltip,""
8
BEESWAX_label,"Cookie ids"
9
CUSTOMER_label,"Customer ids"
10
IDFA_label,"IOS ids"
11
AD_ID_label,"Android ids"
12
segment_name_label,"Segment name"
13
segment_name_tooltip,"The name of the segment that will be populated in Beeswax. Default to mediarithmics segment name."
14
segment_description_label,"Segment description"
15
segment_description_tooltip,"The description of the segment that will be populated in Beeswax. Default to mediarithmics segment description."
16
advertiser_id_label,"Advertiser ID",
17
advertiser_id_tooltip,"If segment should not belong to the overall beeswax account but to a specific advertiser, please enter its ID.",
18
customer_user_identifier_label,"Customer identifier"
19
customer_user_identifier_tooltip,"Path to the customer identifier property when sending customer ids. Examples : USER_EMAIL:hash | USER_AGENT:mappings[0].user_agent_id"
20
continent_label,"Continent"
21
continent_tooltip,"The destination continent data centers to upload the data. Only one continent may be specified per upload."
Copied!

Managing layouts

get
https://api.mediarithmics.com
/v1/plugins/:pluginId/versions/:versionId/properties_layout
Get a layout
put
https://api.mediarithmics.com
/v1/plugins/:pluginId/versions/:versionId/properties_layout
Upload a layout
In case of JSON not structured as expected error, you can use Schema to validate your file.
get
https://api.mediarithmics.com
/v1/plugins/:pluginId/versions/:versionId/properties_layout/localizations/locale=:locale
Get a translation file
put
https://api.mediarithmics.com
/v1/plugins/:pluginId/versions/:versionId/properties_layout/localizations/locale=en-US
Upload a translation file
Last modified 11d ago