api:iptv:device:create
Table of Contents
API : IPTV : Device : Create
Introduction
This request will add an STB device to a customer (with feature IPTVPRIVATE or IPTVBUSINESS), so that the customer may use the device to view the channels and use the services that the customer has subscribed to.
Only STB's and Android tablets can be added. iOS, Android phones and web clients are automatically created when they login for the first time.
Request
| URL | https://api.telecomx.dk/iptv/device | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if customer has feature IPTVBUSINESS RESELLER if customer has IPTVBUSINESS or IPTVPRIVATE ADMIN |
||
| Body | customer | Id | Id of the customer to assign the device to. |
| mac | String | MAC address of device. | |
| name | String | [optional] Name of device, e.g. 'Living room'. Null to auto-generate it. |
|
| type | String | Type of device: STB - Set Top Box ANDROID - Android based mobile or tablet using the app |
|
| enabled | Boolean | [optional] True if the device is enabled, false if blocked. Default true. |
|
| streamOnly | Boolean | [optional] If true, only base channel streams will be served to the STB. DVB and local streams are ignored. Default false. |
|
| developmentMode | Boolean | [optional] True if development mode is enabled for this device, default false. (ADMIN only). |
|
| iotId | String | Id used for mqtt functionality | |
| packages | Array | List of subscription packages the device has access to. Only if customer has feature IPTVBUSINESS. For IPTVPRIVATE customer see Subscriptions. |
|
| packages[]._id | Id | Id of the subscription package. | |
| packages[].start | Date | [optional] Date and time the package will begin, null for now. |
|
| packages[].end | Date | [optional] Date and time the package expires, null if no expiration. |
|
| customFields | Array | [optional] List of custom fields values (if used), otherwise null. |
|
| customFields[]._id | Id | Id of the custom field. | |
| customFields[].value | String | Value of the custom field. | |
| groups | Array | [optional] List of id's of groups the device belongs to. |
|
| notes | String | [optional] Notes about the device. |
|
| custom | Object | [optional] Custom data, max 4096 bytes. |
|
| favorites | Array | [optional] List of id's of channels that are on the favorite list. |
|
| listMode | String | [optional] How to list TV channels: FAV - only those marked as favorite. NUMBER - By channel number. ALPHA - By channel name. |
|
| volume | Number | [optional] Current volume of device, 0-100% (type STB only). |
|
| audioMode | Number | [optional] STB audio mode (type STB only): 0 - Analog only 1 - Analog and SPDIF 2 - Analog and SPDIF with AC3 support |
|
| modules | Object | [optional] STB UI modules to enable. (type STB only). |
|
| modules.inherit | Boolean | [optional] True to inherit modules settings, false for individual settings. |
|
| modules.tv | Boolean | [optional] TV module. |
|
| modules.media_browser | Boolean | [optional] Media browser module. |
|
| modules.vclub | Boolean | [optional] Archive module. |
|
| modules.vclub2 | Boolean | [optional] Recording module. |
|
| modules.audioclub | Boolean | [optional] Audio club module. |
|
| modules.radio | Boolean | [optional] Radio module. |
|
| modules.settings | Boolean | [optional] Settings module. |
|
| modules.settingsEx | Boolean | [optional] Sensitive settings module. |
|
| modules.internet | Boolean | [optional] Internet browser module. |
|
| showAfterLoading | String | What to show after boot: last_channel or main_menu (type STB only). | |
| playInPreviewByOk | Number | 1 to play channel in preview, 0 to play channel fullscreen when OK is pressed (type STB only). | |
| theme | String | Always 'default' (type STB only). | |
| primaryAudioLanguage | String | Primary audio language: dan, eng, nor, swe, fin (type STB only). | |
| secondaryAudioLanguage | String | Secondary audio language: dan, eng, nor, swe, fin (type STB only). | |
| primarySubtitleLanguage | String | Primary subtitle language: dan, eng, nor, swe, fin or blank for none (type STB only). | |
| secondarySubtitleLanguage | String | secondary subtitle language: dan, eng, nor, swe, fin or blank for none (type STB only). | |
| hdmiReaction | Number | Automatic standby after this number of seconds, 0 = off (type STB only). | |
| screensaverDelay | Number | Activate screensaver of this number of seconds of no video playing, 0 = off (type STB only). | |
| playbackBufferBytes | Number | Playback buffer in bytes, 0 = default (type STB only). | |
| playbackBufferSize | Number | Playback buffer size, 0 = default (type STB only). | |
| sleepTimer | Number | Amount of minutes before the device goes to sleep. Min value is 0, max is 480 (type STB only). | |
| country | String | Country for language of user interface: DK, EN (type STB only). | |
| launcherConfig | ObjectId | Configuration data for tablet launcher (Android tablet only) | |
| tabletProfile | ObjectId | A commonly shared launcher configuration for Android tablets. Successor to launcherConfig. (Android tablet only) | |
Query example
{
customer: '12345678901234567890ABCD',
mac: '00:01:79:12:34:56',
name: 'Living room',
enabled: true,
streamOnly: false,
developmentMode: false,
packages: [
{
_id: '1234567890123457890CCCC',
start: '2016-01-01T00:00:00.000Z',
end: '2016-01-01T00:00:00.000Z'
},
{
id: ObjectId('12345678901234567890DDDD')
}
],
customFields: [
{ _id: 12345678901234567890FFF0', value: 'Standard' }
],
groups: [
'12345678901234567890EEE0'
],
notes: 'STB is placed behind the TV with a remote extender',
custom: null,
favorites: [
'12345678901234567890AABB',
'12345678901234567890AABD'
]
}
Response
The newly created device.
| JSON object | |||
|---|---|---|---|
| _id | Id | Unique id of the device. | |
| type | String | Type of device: STB - Set Top Box IOS - iPhone/iPad using the app ANDROID - Android based mobile or tablet using the app WEB - Web browser client | |
| mac | String | MAC address of device (type STB only). | |
| name | String | Name of device, e.g. 'Living room' or 'Johns iPhone'. | |
| enabled | Boolean | True if the device is enabled, false if blocked. | |
| streamOnly | Boolean | If true, only base channel streams will be served to the STB. DVB and local streams are ignored (type STB only). | |
| developmentMode | Boolean | True if development mode is enabled for this device. | |
| iotId | String | Id used for mqtt functionality | |
| packages | Array | List of subscription packages the device has access to. Only if customer has feature IPTVBUSINESS. For IPTVPRIVATE customer see Subscriptions. | |
| packages[]._id | Id | Id of the subscription package. | |
| packages[].start | Date | Date and time the package will begin. | |
| packages[].end | Date | Date and time the package expires, null if no expiration. | |
| customFields | Array | List of custom fields values (if used), otherwise null. | |
| customFields[]._id | Id | Id of the custom field. | |
| customFields[].value | String | Value of the custom field. | |
| groups | Array | List of id's of groups the device belongs to. | |
| notes | String | Notes about the device. | |
| custom | Object | Custom data, max 4096 bytes. | |
| info | Object | Current readonly data about the device. | |
| info.created | Date | Date the device was added to the system. | |
| info.lastComm | Date | Date and time of latest communication with the device. | |
| info.uptime | Number | Uptime in seconds, 0 if down. | |
| info.vpnUptime | Number | Uptime in seconds for the vpn tunnel, 0 if down. | |
| info.net.public | String | Public IP address the STB is originating from. | |
| info.net.ip | String | IP address of the STB. | |
| info.net.gateway | String | Default gateway. | |
| info.net.dns | String | DNS server(s). | |
| info.model | String | The model of the device, e.g. 'MAG250' or 'iPhone 6S'. | |
| info.serial | String | Serial number of the device (type STB only). | |
| info.appVersion | String | App version as reported by device (not STB). | |
| info.bandwidth | Number | Current bandwidth usage (type STB only). | |
| info.wifi | Boolean | True if device is using wifi (type STB only). | |
| info.lan | Boolean | True if device is using a lan connection (type STB only). | |
| info.channel | Id | Channel the device is currently showing, Null if none. | |
| info.channelSource | String | How is the channel served: BASE, DVB or LOCAL. | |
| info.lastchannel | Id | Last viewed channel on the device. | |
| info.playback | Id | EPG id of the program currently being shown on the device from the archive or from a recording. Null if none. | |
| info.playbackType | String | If in playback, then this is the type of media being played: RECORDING or ARCHIVE. | |
| info.channelName | String | Name of the channel currently showing (live) or program was shown on (playback) or null if none. | |
| info.epgTitle | String | Name of the program. | |
| info.epgSubTitle | String | Subtitle of the program. | |
| info.endStart | Date | Start date/time of the program. | |
| info.epgEnd | Date | End date/time of the program. | |
| info.epgBaseChannel | Number | Base channel id of the channel the program is/was on. | |
| info.firmware.name | String | Name of the current firmware (type STB only). | |
| info.firmware.version | String | Firmware version (type STB only). | |
| info.firmware.date | String | Firmware date (type STB only). | |
| info.portalVersion | String | Portal version number (type STB only). | |
| info.apiVersion | String | UI API engine version (type STB only). | |
| info.videoOut | String | Video output mode: HDMI or RCA. | |
| info.videoMode | String | Video resolution and mode: 480, 576, 720p, 720i, 1080p, 1080i. | |
| info.language | String | Language for the UI (type STB only). | |
| info.timezone | String | Timezone for the UI (type STB only). | |
| info.playing | Boolean | True if currently playing anything (only if type is STB). | |
| info.paused | Boolean | True if currently paused (only if type is STB). | |
| info.position | Number | Position in seconds in the media currently playing, live is seconds since midnight (only if type is STB). | |
| info.place | String | Which section of the STB/APP with FlexCare is currently active, ex. tv, timeshift, radio, epg.simple, epg, vclub, vclub2, settings, main_menu | |
| info.videoBitrate | Number | Bitrate of the video currently showing. | |
| info.videoFramerate | Number | Framerate of the video currently showing. | |
| info.videoWidth | Number | Width of the video currently showing. | |
| info.videoHeight | Number | Height of the video currently showing. | |
| info.videoURL | String | URL of video currently showing (only if type is STB) (ADMIN only). | |
| info.tunnelServer | String | The tunnel server the device is connected to (only if type is STB) (ADMIN only). | |
| info.lanMac | String | MAC of the LAN network card. | ANDROID (tablet) |
| info wifiMac | String | Mac of the WIFI network card. | ANDROID (tablet) |
| stbRequests | Array | List of requests waiting for the device to be retrieved and executed (type STB only). | |
| stbRequests[].action | String | Type of action to perform: DVB - update DVB configuration and reboot if needed. CHANNELS - reload the channels list UI - reload the user interface SCREENSHOT - take a screenshot SPEEDTEST - check Internet connection speed MANAGEMENT - enable debug port for remote service. REBOOT - reboot the STB. SCRIPT - download and execute script specified in data MESSAGE - show the message specified in data. VIDEO - show the message & video specified in data. PLAYCHANNEL - show the channel specified in data. SWITCH_OFF - turn the STB off. BLOCK - Block the STB. UBLOCK - Unblock the STB. JS - run code in the UI. FIRMWARE - Upgrade firmware. PLAYRADIOCHANNEL - play a radio channel. UIDEBUG - enable UI debugger. VOLUME - set current volume. EMULATEKEYS - emulate remote control keypresses. | |
| stbRequests[].data | String | Additional settings for the request, if any. | |
| stbRequests[].date | Date | Date when request was queued. | |
| stbRequests[].when | Date | Date/time when request shall be sent to the STB. null if not used = as soon as possible. | |
| stbRequests[].id | Id | Id of the request. | |
| screenshot | Id | Id of latest screenshot taken. Null if none (type STB only). | |
| speedtest.date | Date | Date the speedtest was performed (type STB only). | |
| speedtest.down | Number | Speedtest downstream average speed (type STB only). | |
| speedtest.up | Number | Speedtest upstream average speed (type STB only). | |
| favorites | Array | List of id's of TV channels that are on the favorites list. | |
| listMode | String | How to list TV channels: FAV - only those marked as favorite. NUMBER - By channel number. ALPHA - By channel name. | |
| volume | Number | Current volume of device, 0-100% (type STB only). | |
| audioMode | Number | STB audio mode (type STB only): 0 - Analog only 1 - Analog and SPDIF 2 - Analog and SPDIF with AC3 support | |
| modules | Object | STB UI modules to enable. (type STB only). | |
| modules.tv | Boolean | TV module. | |
| modules.media_browser | Boolean | Media browser module. | |
| modules.dvb | Boolean | DVB module. | |
| modules.vclub | Boolean | Archive module. | |
| modules.vclub2 | Boolean | Recording module. | |
| modules.audioclub | Boolean | Audio club module. | |
| modules.radio | Boolean | Radio module. | |
| modules.settings | Boolean | Settings module. | |
| modules.settingsEx | Boolean | Sensitive settings module. | |
| modules.internet | Boolean | Internet browser module. | |
| showAfterLoading | String | What to show after boot: last_channel or main_menu (type STB only). | |
| playInPreviewByOk | Number | 1 to play channel in preview, 0 to play channel fullscreen when OK is pressed (type STB only). | |
| theme | String | Always 'default' (type STB only). | |
| primaryAudioLanguage | String | Primary audio language: dan, eng, nor, swe, fin (type STB only). | |
| secondaryAudioLanguage | String | Secondary audio language: dan, eng, nor, swe, fin (type STB only). | |
| primarySubtitleLanguage | String | Primary subtitle language: dan, eng, nor, swe, fin or blank for none (type STB only). | |
| secondarySubtitleLanguage | String | secondary subtitle language: dan, eng, nor, swe, fin or blank for none (type STB only). | |
| hdmiReaction | Number | Automatic standby after this number of seconds, 0 = off (type STB only). | |
| screensaverDelay | Number | Activate screensaver of this number of seconds of no video playing, 0 = off (type STB only). | |
| playbackBufferBytes | Number | Playback buffer in bytes, 0 = default (type STB only). | |
| playbackBufferSize | Number | Playback buffer size, 0 = default (type STB only). | |
| country | String | Country for language of user interface: DK, EN (type STB only). | |
| sleepTimer | Number | Amount of minutes before the device goes to sleep. Min value is 0, max is 480 (type STB only). | |
| launcherConfig | ObjectId | Configuration data for tablet launcher (Android tablet only) | |
| tabletProfile | ObjectId | A commonly shared launcher configuration for Android tablets. Successor to launcherConfig. (Android tablet only) | |
| appRequests | Array | List of requests waiting for the device to be retrieved and executed. Used by Android tablets only. | |
| appRequests[].action | String | Type of action to perform: UI - reload the user interface REBOOT - reboot the tablet. MESSAGE - show the message specified in data. VIDEO - show the message & video specified in data. *START_APP* - starts the app with the package name specified in app *UPDATE_APP* - updates the app with the package name specified in app *UNLOCK* - unlocks the tablet | |
| appRequests[].data | String | Additional settings for the request, if any. | |
| appRequests[].date | Date | Date when request was queued. | |
| appRequests[].when | Date | Date/time when request shall be sent to the tablet. null if not used = as soon as possible. | |
| appRequests[].id | Id | Id of the request. | |
Note that properties holding no value may be omitted from the object.
Example
{ _id: '12345678901234567890ABCD', type: 'STB', mac: '00:01:79:12:34:56', name: 'Living room', enabled: true, streamOnly: false, developmentMode: false, packages: [ { _id: '1234567890123457890CCCC', start: '2016-01-01T00:00:00.000Z', end: '2016-01-01T00:00:00.000Z' }, { id: ObjectId('12345678901234567890DDDD') } ], customFields: [ { _id: 12345678901234567890FFF0', value: 'Standard' } ], groups: [ { _id: '12345678901234567890EEE0', name: 'Building A' } ], notes: 'STB is placed behind the TV with a remote extender', custom: null, info: { created: '2016-01-01T00:00:00.000Z', lastComm: 2016-02-03T12:34:56.000Z', uptime: 563665, vpnUptime: 563602, net: { public: '213.83.189.234', ip: '192.168.0.10', gateway: '192.168.0.1', dns: '192.168.0.1' }, model: 'MAG275', serial: '5635473547256433355', bandwidth: 5123, wifi: false, lan: true, channel: null, lastChannel: '1234567890124567890FEDC', playback: '7_149485867', playbackType: 'RECORDING', channelName: 'TV2', epgBaseChannelId: 7, epgTitle: 'Nyhederne', epgSubTitle: 'De seneste nyheder fra ind og udland', epgStart: '2017-01-01T00:00:00Z', epgEnd: '2017-01-01T00:30:00Z', firmware: { name: 'Playmaker_1.0', version: '1.0a', date: '2017-01-01 12:23:00' }, portalVersion: '1.0', apiVersion: '4.2.3', videoOut: 'HDMI', videoMode: '1080p', language: 'da', timezone: 'Europe/Copenhagen' }, stbRequests: [ { action: 'DVB', date: '2016-01-01T00:00:00.000Z', when: null, id: '12345678901234567890DDDD' }, { action: 'REBOOT', date: '2016-01-01T00:00:00.000Z', when: '2019-01-01T00:00:00.000Z', id: '12345678901234567890DDDE' } ], screenshot: '12345678901234567890BBBB', speedtest: { date: '2016-01-01T12:34:56.000Z', down: 8192, up: 512 }, favorites: [ '12345678901234567890AABB', '12345678901234567890AABD' ], listMode: 'NUMBER', volume: 80, audioMode: 1, modules: { tv: true, dvb: true, media_browser: false, vclub: true, vclub2: true, audioclub: false, radio: true, settings: true, settingsEx: false, internet: true } }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | customer | Customer not found |
| 409 | customer | Customer does not have IPTV |
| 409 | mac | MAC address is in use by another device |
| 422 | mac | MAC address is invalid or not approved |
| 409 | type | Devices of the specified type cannot be created, they are created during initial login |
| 404 | packages[]._id | Package not found |
| 409 | packages[]._id | Package can only be included once |
| 409 | packages[]._id | Only 1 main package is allowed |
| 409 | packages[].end | Date is too far into the future - max 12 months |
| 422 | packages[].end | End date cannot be before start date |
| 404 | customFields[]._id | Field not found |
| 422 | customFields[].value | Invalid value |
| 404 | groups | One or more groups was not found |
| 403 | access_denied | Insufficient access level |
| 404 | tabletProfile | Tablet profile not found |
| 500 | internal_error | <Unspecified> |
api/iptv/device/create.txt · Last modified: 2024/11/19 09:23 by Mikkel Frederiksen