Webportal v2

embedded apps

API Reference - media.radioInfo

Required Privacy: Location

This API allows to work with the media player radio module.

Info about Frequency Radio, N° Preset Radio, Band Radio and Radio station name.

Input Parameter
No input params
Output Data
Data name Description Type Unit/Values Example
data

Radio info data.

Object

/
data
 .sid

Radio SID identifier.

int

n/a

3
data
 .band

string

- fm

- am

- dab
fm
data
 .name

Radio program name.

string

n/a

Cadena DIAl
data
 .preset

Selected radio preset.

int

n/a

2
data
 .frequency

AM FM Radio frequency. Field displayed if band == 'fm' || band == 'am'.

int

kHz

96900
data
 .channel

Channel name. Field displayed if band == 'dab'.

string

n/a

6A
data
 .serviceIndex

DAB Service index. Field displayed if band == 'dab'.

int

n/a

2
data
 .serviceCount

DAB Service count. Field displayed if band == 'dab'.

int

n/a

13
data
 .presetList

List of presets.

Array of object

/
data
 .presetList
  .preset

Selected radio preset.

int

n/a

2
data
 .presetList
  .sid

Radio SID identifier.

int

n/a

3
data
 .presetList
  .band

string

- fm

- am

- dab
fm
data
 .presetList
  .name

Radio program name.

string

n/a

Cadena DIAl
data
 .presetList
  .frequency

AM FM Radio frequency. Field displayed if band == 'fm' || band == 'am'.

int

kHz

96900
data
 .presetList
  .channel

Channel name. Field displayed if band == 'dab'.

string

n/a

6A
data
 .presetList
  .serviceIndex

DAB Service index. Field displayed if band == 'dab'.

int

n/a

2
data
 .presetList
  .serviceCount

DAB Service count. Field displayed if band == 'dab'.

int

n/a

13
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
webportal.get(
    /* api name */
    "media.radioInfo",
    /* parameters */
     null
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "GET", 
  "api": "media.radioInfo",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "media.radioInfo",
  "status": 200,
  "statusText": "OK", 
  "data": {
    "data": {
      "sid": 3,
      "band": "fm",
      "name": "Cadena DIAL",
      "preset": 2,
      // if band FM/AM
      "frequency": 96900,
      // if band DAB
      "channel": "6A",
      "serviceIndex": 2,
      "serviceCount": 13,
      "presetList": [
        /* Preset 1 */
        {
          "preset": 0,
          "sid": 4,
          "band": "fm",
          "frequency": "96.9",
          "channel": "6A",
          "serviceIndex": 2,
          "serviceCount": 13,
          "name": "Cadena DIAL"
        }, {
          /* Preset 2 */
        }, {
          /* Preset 3 */
        }
      ]
    }
  } 
}

false

This API allows to work with the media player radio module.

Info about Frequency Radio, N° Preset Radio, Band Radio and Radio station name.

Input Parameter
Param name Description Type Unit/Values Example Required
sid

SID of the radio station to select if band is DAB.

int

n/a

42 true
frequency

SID of the radio station to select if band is AM/FM.

int

kHz

96000 true
Output Data
No outputted data
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
webportal.set(
    /* api name */
    "media.radioInfo",
    /* parameters */
     { 
      "sid": 42,
      "frequency": 96000
        }
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
7
8
9
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SET", 
  "api": "media.radioInfo",
  "params":  { 
    "sid": 42,
    "frequency": 96000
  }
}
1
2
3
4
5
6
7
8
9
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "media.radioInfo",
  "status": 200,
  "statusText": "OK"
}

false

This API allows to work with the media player radio module.

Info about Frequency Radio, N° Preset Radio, Band Radio and Radio station name.

Input Parameter
No input params
Output Data
Data name Description Type Unit/Values Example
data

Radio info data.

Object

/
data
 .sid

Radio SID identifier.

int

n/a

3
data
 .band

string

- fm

- am

- dab
fm
data
 .name

Radio program name.

string

n/a

Cadena DIAl
data
 .preset

Selected radio preset.

int

n/a

2
data
 .frequency

AM FM Radio frequency. Field displayed if band == 'fm' || band == 'am'.

int

kHz

96900
data
 .channel

Channel name. Field displayed if band == 'dab'.

string

n/a

6A
data
 .serviceIndex

DAB Service index. Field displayed if band == 'dab'.

int

n/a

2
data
 .serviceCount

DAB Service count. Field displayed if band == 'dab'.

int

n/a

13
data
 .presetList

List of presets.

Array of object

/
data
 .presetList
  .preset

Selected radio preset.

int

n/a

2
data
 .presetList
  .sid

Radio SID identifier.

int

n/a

3
data
 .presetList
  .band

string

- fm

- am

- dab
fm
data
 .presetList
  .name

Radio program name.

string

n/a

Cadena DIAl
data
 .presetList
  .frequency

AM FM Radio frequency. Field displayed if band == 'fm' || band == 'am'.

int

kHz

96900
data
 .presetList
  .channel

Channel name. Field displayed if band == 'dab'.

string

n/a

6A
data
 .presetList
  .serviceIndex

DAB Service index. Field displayed if band == 'dab'.

int

n/a

2
data
 .presetList
  .serviceCount

DAB Service count. Field displayed if band == 'dab'.

int

n/a

13
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
webportal.subscribe(
    /* api name */
    "media.radioInfo",
    /* parameters */
     null,
    /* callback for `NOTIFY` messages */
    async (notifyMessage) => {
      if (notifyMessage.status === 200) {
        /* handle `NOTIFY` response */
      }
      else { /*  handle `NOTIFY` error  */ }
    }
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SUBSCRIBE", 
  "api": "media.radioInfo",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
11
// --- format of the `REPLY` message ---
// type: acknowledge the status of the subscription
// reception: only once after the subscription request
// contains outputed data: no
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "status": 200,
  "statusText": "OK"
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// --- format of the `NOTIFY` message ---
// type: event message about the subscription
// reception: each time the conditions of the subscription are met
// contains outputed data: yes
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "NOTIFY",
  "api": "media.radioInfo",
  "status": 200,
  "statusText": "OK", 
  "data": {
    "data": {
      "sid": 3,
      "band": "fm",
      "name": "Cadena DIAL",
      "preset": 2,
      // if band FM/AM
      "frequency": 96900,
      // if band DAB
      "channel": "6A",
      "serviceIndex": 2,
      "serviceCount": 13,
      "presetList": [
        /* Preset 1 */
        {
          "preset": 0,
          "sid": 4,
          "band": "fm",
          "frequency": "96.9",
          "channel": "6A",
          "serviceIndex": 2,
          "serviceCount": 13,
          "name": "Cadena DIAL"
        }, {
          /* Preset 2 */
        }, {
          /* Preset 3 */
        }
      ]
    }
  } 
}