Skip to main content

Widget type schema

Endpoint GET /widget-types/:id/schema

Retrieve a widget type's JSON schema.

Please Note

The schema will be different for each widget type. You can explore the different schemas with the Widget Data Explorer Tool tool.

Path Parameters

Required
  • id - The widget type's id.

Example Request:

curl -H "Authorization: Bearer ACCESS_TOKEN" "https://api.commoninja.com/platform/api/v1/widget-types/countdown/schema"

Example Response:

{
"$id": "countdown",
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "plugin"
}
],
"properties": {
"data": {
"$ref": "#/definitions/IPluginData"
}
},
"definitions": {
"IPluginData": {
"type": "object",
"properties": {
"content": {
"$ref": "#/definitions/IPluginContent"
},
"settings": {
"$ref": "#/definitions/IPluginSettings"
},
"styles": {
"$ref": "#/definitions/IPluginStyles"
}
},
"required": ["content", "settings", "styles"],
"additionalProperties": false
},
"IPluginContent": {
"type": "object",
"properties": {
"timerTitle": {
"type": "string"
},
"postTitle": {
"type": "string"
},
"postDescription": {
"type": "string"
},
"countdownType": {
"type": "string",
"enum": ["count-to-date", "count-time-by-user"]
},
"expDate": {
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"format": "date-time"
},
{}
]
},
"daysLabel": {
"type": "string"
},
"hoursLabel": {
"type": "string"
},
"minutesLabel": {
"type": "string"
},
"secondsLabel": {
"type": "string"
},
"timerDays": {
"type": "number"
},
"timerHours": {
"type": "number"
},
"timerMinutes": {
"type": "number"
},
"timerSeconds": {
"type": "number"
},
"postCountdownType": {
"type": "string",
"enum": ["none", "hide", "message"]
},
"showPostConfetti": {
"type": "boolean"
},
"showPostCountdown": {
"type": "boolean"
},
"postButtonText": {
"type": "string"
},
"postButtonLink": {
"type": "string"
}
},
"additionalProperties": false
},
"IPluginSettings": {
"type": "object",
"properties": {
"showTitle": {
"type": "boolean"
},
"showContainer": {
"type": "boolean"
},
"showCards": {
"type": "boolean"
},
"showLabels": {
"type": "boolean"
},
"showDays": {
"type": "boolean"
},
"showHours": {
"type": "boolean"
},
"showMinutes": {
"type": "boolean"
},
"showSeconds": {
"type": "boolean"
},
"showColon": {
"type": "boolean"
},
"showPostContainer": {
"type": "boolean"
}
},
"additionalProperties": false
},
"IPluginStyles": {
"type": "object",
"properties": {
"mainWrapper": {
"type": "object"
},
"title": {
"type": "object"
},
"layoutId": {
"type": "string",
"const": "default"
},
"fontId": {
"type": "string"
},
"customCSS": {
"type": "string"
},
"skinId": {
"type": "number"
},
"animationType": {
"type": "string",
"enum": ["dissolve", "flip", "tick", "normal"]
},
"layout": {
"type": "string",
"enum": [
"layout-1",
"layout-2",
"layout-3",
"layout-4",
"layout-5",
"layout-6"
]
},
"container": {
"type": "object"
},
"containerBg": {
"type": "array",
"items": {
"type": "string"
}
},
"containerBorderRadius": {
"type": "number"
},
"cards": {
"type": "object"
},
"cardsBorderRadius": {
"type": "number"
},
"cardsBorderWidth": {
"type": "number"
},
"cardsBorderColor": {
"type": "string"
},
"cardsBg": {
"type": "array",
"items": {
"type": "string"
}
},
"numbers": {
"type": "object"
},
"labels": {
"type": "object"
},
"labels2": {
"type": "object"
},
"colonColor": {
"type": "string"
},
"separatorColor": {
"type": "string"
},
"postContainer": {
"type": "object"
},
"postContainerBg": {
"type": "array",
"items": {
"type": "string"
}
},
"postTitle": {
"type": "object"
},
"postDescription": {
"type": "object"
},
"countdownSize": {
"type": "string",
"enum": ["small", "medium", "big"]
}
},
"additionalProperties": false
}
}
}