Segment JSON schema

schema.json

The system settings file for a segment.
{
  "schema": object (required) {
    "scope": string (required),
    "version": string (required),
    "settings": array (required) [
      {
        "key": string (required),
        "displayName": string (required),
        "layout": enum (required) ["description", "textBox", "selection", "checkBox", "button"],
        "items": array [
          {
            "displayName": string (required),
            "value": any (required)
          }
        ],
        "linkedUrl": string,
        "oauthId": integer
      }
    ]
  }
}

Example

Properties

"schema"

The root property of the segment.

"scope"

The segment's package name consisting of characters in the range of [a-zA-Z0-9._-] and maximum 64 characters in length.

Restrictions: Regex pattern: ^[a-zA-Z0-9._-]+$

"version"

The version of the schema. Maximum 64 ASCII chars in length.

"settings"

The list of setting options for the segment. The options are displayed in the same order as they are in the array.

"key"

The unique key of a setting option. The key should consist of characters in the range of [a-zA-Z0-9._-] and maximum 64 characters in length.

Restrictions: Regex pattern: ^[a-zA-Z0-9._-]+$

"displayName"

The title of a setting option that is displayed on the N host app UI. It can contain a reference to a string defined in string.json. Maximum 1KB ASCII characters in length.

"layout"

["description", "textBox", "selection", "checkBox", "button"]

UI layout components for a setting option in the N host app.

"description"
Text views to display the information of the setting option. The description can contain references to strings defined in string.json. Maximum 10KB ASCII chars in length.
"textBox"
Text fields that allow a user to set the value for the setting option.
"selection"
drop-down lists that provide a list of values to select from.
"checkBox"
Checkboxes that allow a user to select multiple items from a set.
"button"
Buttons that can be used to open a link that is specified by linkedUrl or to start an OAuth authorization process that is speficied by oauthId. OAuth settings are defined in oauth.json file. If the OAuth is successfully authorized, the text displayed on the button will be "Log Out"; otherwise the text displayed on the button will be the displayName of the setting option.

"items"

A set of options to select from for selection and checkbox components. The items are displayed in the same order as they are in the array.

Restrictions: Minimum items: 1

"displayName"

The item's name that is diplayed on the N host app UI. It can contain references to strings in the string.json file. Maximum 1KB ASCII characters in length.

"value"

The value of the item. It can be in type of object or array.

"linkedUrl"

The URL to redirect to. Maximux 4096byte in size.

"oauthId"

The OAuth ID for OAuth authorization procedure. The Personalized Radio function sets the value of the OAuth option to true, if the OAuth has been successfully authorized and the token has been stored in the server. The Personalized Radio function sets the value of the OAuth option to false, if the user has logged out and the token has been cleared. In some exception cases, such an unexpected log-out due to the expriation of the token, the segment should set the value of Oauth option to false via setSegmentConfig API.

Restrictions: Minimum: 0, Maximum: 255