DIAL Server API
Version: 1.0.0
Status:
DIALServer interface for Thunder framework.
(Defined by DIALServer.json)
Table of Contents
Introduction
Scope
This document describes purpose and functionality of the DIALServer interface (version 1.0.0). It includes detailed specification about its properties provided and notifications sent.
Case Sensitivity
All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
Acronyms, Abbreviations and Terms
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
References
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
Description
DIAL Server JSON-RPC interface.
Properties
The following properties are provided by the DIALServer interface:
DIALServer interface properties:
Property | R/W | Description |
---|---|---|
state | read/write | Current application running state |
state property
Provides access to the current application running state.
Description
This property can be used to update the running status of an un-managed application (i.e. running in passive mode). For DIALServer-managed applications this property shall be considered read-only.
The application name parameter shall be passed as the index to the property, i.e.
state@<application-name>
.
Index
Name | Type | M/O | Description |
---|---|---|---|
application-name | string | mandatory | ... |
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | string | mandatory | Current application running state (must be one of the following: Hidden, Started, Stopped) |
Name | Type | M/O | Description |
---|---|---|---|
(property) | string | mandatory | Current application running state (must be one of the following: Hidden, Started, Stopped) |
Errors
Message | Description |
---|---|
ERROR_UNKNOWN_KEY |
Specified application does not exist |
ERROR_ILLEGAL_STATE |
Specified application is running in active mode |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.state@YouTube"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": "Started"
}
Set Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.state@YouTube",
"params": "Started"
}
Set Response
{
"jsonrpc": "2.0",
"id": 42,
"result": "null"
}
Notifications
Notifications are autonomous events triggered by the internals of the implementation and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.
The following events are provided by the DIALServer interface:
DIALServer interface events:
Notification | Description |
---|---|
start | Signals that application launch (or show if previously hidden) was requested over DIAL |
stop | Signals that application stop was requested over DIAL |
hide | Signals that application hide was requested over DIAL |
show deprecated | Signals that application show was requested over DIAL |
change deprecated | Signals that application URL change was requested over DIAL |
start notification
Signals that application launch (or show if previously hidden) was requested over DIAL.
Description
This event is sent out only for un-managed applications (i.e. in passive mode).
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.application | string | mandatory | Application name |
params?.parameters | string | optional | Additional application-specific parameters |
params?.payload | string | optional | Additional application-specific payload |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "start",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.start",
"params": {
"application": "YouTube",
"parameters": "watch?v=zpp045FBbQY",
"payload": "..."
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.start
.
stop notification
Signals that application stop was requested over DIAL.
Description
This event is sent out only for un-managed applications (i.e. in passive mode).
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.application | string | mandatory | Application name |
params?.parameters | string | optional | Additional application-specific parameters |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "stop",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.stop",
"params": {
"application": "YouTube",
"parameters": "watch?v=zpp045FBbQY"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.stop
.
hide notification
Signals that application hide was requested over DIAL.
Description
This event is sent out only for un-managed applications (i.e. in passive mode).
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.application | string | mandatory | Application name |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "hide",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.hide",
"params": {
"application": "YouTube"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.hide
.
show notification
Signals that application show was requested over DIAL.
show
is an alternative name for this notification. This name is deprecated and may be removed in the future. It is not recommended for use in new implementations.
Description
This event is sent out only for un-managed applications (i.e. in passive mode).
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.application | string | mandatory | Application name |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "show",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.show",
"params": {
"application": "YouTube"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.show
.
change notification
Signals that application URL change was requested over DIAL.
change
is an alternative name for this notification. This name is deprecated and may be removed in the future. It is not recommended for use in new implementations.
Description
This event is sent out only for un-managed applications (i.e. in passive mode).
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.application | string | mandatory | Application name |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "change",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.change",
"params": {
"application": "YouTube"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.change
.