Table of Contents
API : IPTV : Tablet profiles : Convert
Introduction
This will convert a tablet profile to a launcher config, or vice versa. Note that this endpoint does not save anything, and is merely a utility function for converting between formats.
A tablet profile is a configuration for a tablet's launcher, which can be shared by many tablets.
Launcher config is the legacy format, and is a flat JSON structure saved on each individual tablet (read more: API : IPTV : App : Get Launcher Config)
Request
| URL | https://api.telecomx.dk/iptv/tabletprofile | |||
|---|---|---|---|---|
| Method | POST | |||
| Access level | MANAGER, OWNER, RESELLER if customer has feature IPTVBUSINESS ADMIN | |||
| Query | convertTo | Has to be either “tabletprofile” or “launcherconfig”. If i.e “tabletprofile” is chosen, then it's implied that the conversion is from launcherconfig to tabletprofile. Also works vice versa. | ||
| If convertTo is launcherconfig | |||
|---|---|---|---|
| Body | name | String | Name of the tablet profile |
| customer | ObjectId | Unique ID of customer that owns the profile | |
| rowSpacing | Integer | Vertical distance between apps in pixels | |
| horizontalTopSpacing | Integer | Distance between logo in the top left and clock in the top right (Only for here historical reasons, is put on pages individually) | |
| topRowSpacing | Integer | Distance from apps to the top border of the screen (Only for here historical reasons, is put on pages individually) | |
| powerButton | Boolean | True if the power button is visible, false if not | |
| externalPowerOff | Boolean | True if the power button calls an external app instead of powering off (is used as a sort of standby) | |
| webViewWifiButton | Object | Settings for the wifi button placed in web views, on tablets that don't use PoE | |
| webViewWifiButton.active | Boolean | True if wifi button is visible | |
| webViewWifiButton.topSpacing | Integer | Distance from top border in pixels | |
| webViewWifiButton.leftSpacing | Integer | Distance from left border in pixels | |
| webViewWifiButton.rightSpacing | Integer | Distance from right border in pixels | |
| hotspot | Object | Hotspot settings | |
| hotspot.active | Boolean | True if hotspot is enabled | |
| hotspot.url | String | URL of hotspot page to redirect to | |
| hotspot.checkUrl | String | URL to check if the tablet has wifi | |
| pages | Array | List of pages that the profile has. | |
| Page | Object | Contains page specific properties, and a list of buttons for the given page | |
| background | String | URL to a background image | |
| clockColor | String | Hex-color for the clock | |
| leftSpacing | Integer | Distance from left border of the screen | |
| rowSpacing | Integer | Vertical distance between apps in pixels | |
| topRowSpacing | Integer | Distance from apps to the top border of the screen | |
| buttons | Array | Array of the buttons for this page | |
| Button | Object | The buttons that make up the layout of the tablet | |
| row | Integer | Row that the button is positioned in | |
| position | Integer | Position that the button has in its row | |
| label | String | Button label, shown below icon | |
| labelColor | String | Hex-formatted text color for the label | |
| enabled | Boolean | True if button is active and visible | |
| type | Enum | Determines the functionality of the button. “PAGE” jumps to another page with a page number, “NAMED_PAGE goes to a page with a name (TV, RADIO, etc), “APP” opens an app installed on the device, and “WEBVIEW” opens a web view with a given url. “MODULE” “PAGE”, “APP”, “VIDEO”, or “WEBVIEW” | |
| value | String | The value of the button, used together with type. If the type is a page, it will be a page number. If the type is an app, it will be an app name (package name). If the type is webview or video, it will be an URL. | |
| clearAppData | Boolean | True if the app data (cache, logins, etc) will be deleted when the app is closed | |
| Icon | Object | Properties for the button/app icon | |
| icon.url | String | URL for the image | |
| icon.width | Integer | Width of the image | |
| icon.height | Integer | Width of the image | |
| icon.hoverIcon | String | [optional] Alternate icon if user is hovering (using keyboard or fly mouse) | |
NOTE: This format is a flat JSON structure, that uses following convention for its properties: s[screen number]R[row number]Button[button number]_[some key]
Example could be: s1R1Button3_type Which would be a button on the first screen, first row, and third button on that row. Properties without a button, i.e “s1clockColor” or “s1background” are properties for all of screen 1.
In the following definition, [i]
| If convertTo is tabletprofile |
|---|
| Body | s[i]background | String | Background image as URL |
Query examples
https://api.telecomx.dk/iptv/tabletprofile/convert?convertTo=launcherconfig https://api.telecomx.dk/iptv/tabletprofile/convert?convertTo=tabletprofile
Response
| JSON object | ||
|---|---|---|
| _id | ObjectId | Unique ID for the device |
| name | String | Name of the tablet profile |
| customer | ObjectId | Unique ID of customer that owns the profile |
| rowSpacing | Integer | Vertical distance between apps in pixels |
| horizontalTopSpacing | Integer | Distance between logo in the top left and clock in the top right (Only for here historical reasons, is put on pages individually) |
| topRowSpacing | Integer | Distance from apps to the top border of the screen (Only for here historical reasons, is put on pages individually) |
| powerButton | Boolean | True if the power button is visible, false if not |
| externalPowerOff | Boolean | True if the power button calls an external app instead of powering off (is used as a sort of standby) |
| webViewWifiButton | Object | Settings for the wifi button placed in web views, on tablets that don't use PoE |
| webViewWifiButton.active | Boolean | True if wifi button is visible |
| webViewWifiButton.topSpacing | Integer | Distance from top border in pixels |
| webViewWifiButton.leftSpacing | Integer | Distance from left border in pixels |
| webViewWifiButton.rightSpacing | Integer | Distance from right border in pixels |
| hotspot | Object | Hotspot settings |
| hotspot.active | Boolean | True if hotspot is enabled |
| hotspot.url | String | URL of hotspot page to redirect to |
| hotspot.checkUrl | String | URL to check if the tablet has wifi |
| pages | Array | List of pages that the profile has. |
| Page | Object | Contains page specific properties, and a list of buttons for the given page |
|---|---|---|
| background | String | URL to a background image |
| clockColor | String | Hex-color for the clock |
| leftSpacing | Integer | Distance from left border of the screen |
| rowSpacing | Integer | Vertical distance between apps in pixels |
| topRowSpacing | Integer | Distance from apps to the top border of the screen |
| buttons | Array | Array of the buttons for this page |
| Button | Object | The buttons that make up the layout of the tablet |
|---|---|---|
| row | Integer | Row that the button is positioned in |
| position | Integer | Position that the button has in its row |
| label | String | Button label, shown below icon |
| labelColor | String | Hex-formatted text color for the label |
| enabled | Boolean | True if button is active and visible |
| type | Enum | Determines the functionality of the button. “PAGE” jumps to another page with a page number, “NAMED_PAGE goes to a page with a name (TV, RADIO, etc), “APP” opens an app installed on the device, and “WEBVIEW” opens a web view with a given url. “MODULE” “PAGE”, “APP”, “VIDEO”, or “WEBVIEW” |
| value | String | The value of the button, used together with type. If the type is a page, it will be a page number. If the type is an app, it will be an app name (package name). If the type is webview or video, it will be an URL. |
| clearAppData | Boolean | True if the app data (cache, logins, etc) will be deleted when the app is closed |
| Icon | Object | Properties for the button/app icon |
| icon.url | String | URL for the image |
| icon.width | Integer | Width of the image |
| icon.height | Integer | Width of the image |
| icon.hoverIcon | String | [optional] Alternate icon if user is hovering (using keyboard or fly mouse) |
Example - normal
{ _id: '1234567890ABCDEFGHIJKLMN', name: 'Main profile', customer '2345678901ABCDEFGHIJKLMN', rowSpacing: 60, horizontalTopSpacing: 30, topRowSpacing: 20, powerButton: false, externalPowerOff: false, webViewWifiButton: { active: true, topSpacing: 20, leftSpacing: 20, rightSpacing: 35 }, hotspot: { active: true, url: 'https://hotspot.hospitalnorth.dk', checkUrl: 'https://google.dk' }, pages: [{ background: '#FFAABB', clockColor: '#000000', leftSpacing: 20, rowSpacing: 20, topRowSpacing: 20, buttons: [{ row: 0, position: 0, label: 'TV', labelColor: '#FFFFFF', type: 'NAMED_PAGE', value: 'tv', clearAppData: false, icon: { url: 'https://placeholder.com/img/tv.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/tv_hover.png' } }, { row: 0, position: 1, label: 'RADIO', labelColor: '#FFFFFF', type: 'NAMED_PAGE', value: 'radio', clearAppData: false, icon: { url: 'https://placeholder.com/img/radio.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/radio_hover.png' } } ] }, { background: '#1ECCBB', clockColor: '#000000', leftSpacing: 20, rowSpacing: 20, topRowSpacing: 20, buttons: [{ row: 0, position: 0, label: 'Skype', labelColor: '#FFFFFF', type: 'APP', value: 'com.skype', clearAppData: false, icon: { url: 'https://placeholder.com/img/skype.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/skype_hover.png' } }, { row: 0, position: 1, label: 'Chess', labelColor: '#FFFFFF', type: 'app', value: 'com.chess_fun', clearAppData: false, icon: { url: 'https://placeholder.com/img/chess.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/chess_hover.png' } } ] } ] }, { _id: '1234567890ABCDEFGHIJKLMN', name: 'Ambulance profile', customer '2345678901ABCDEFGHIJKLMN', rowSpacing: 60, horizontalTopSpacing: 30, topRowSpacing: 20, powerButton: false, externalPowerOff: false, webViewWifiButton: { active: true, topSpacing: 20, leftSpacing: 20, rightSpacing: 35 }, hotspot: { active: true, url: 'https://hotspot.hospitalnorth.dk', checkUrl: 'https://google.dk' }, pages: [{ background: '#FFAABB', clockColor: '#000000', leftSpacing: 20, rowSpacing: 20, topRowSpacing: 20, buttons: [{ row: 0, position: 0, label: 'TV', labelColor: '#FFFFFF', type: 'NAMED_PAGE', value: 'tv', clearAppData: false, icon: { url: 'https://placeholder.com/img/tv.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/tv_hover.png' } }, { row: 0, position: 1, label: 'RADIO', labelColor: '#FFFFFF', type: 'NAMED_PAGE', value: 'radio', clearAppData: false, icon: { url: 'https://placeholder.com/img/radio.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/radio_hover.png' } } ] }, { background: '#1ECCBB', clockColor: '#000000', leftSpacing: 20, rowSpacing: 20, topRowSpacing: 20, buttons: [{ row: 0, position: 0, label: 'Skype', labelColor: '#FFFFFF', type: 'APP', value: 'com.skype', clearAppData: false, icon: { url: 'https://placeholder.com/img/skype.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/skype_hover.png' } }, { row: 0, position: 1, label: 'Chess', labelColor: '#FFFFFF', type: 'app', value: 'com.chess_fun', clearAppData: false, icon: { url: 'https://placeholder.com/img/chess.png', width: 20, height: 30, hoverIcon: 'https://placeholder.com/img/chess_hover.png' } } ] } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Insufficient access level |
| 403 | customer | Customer does not have required feature |
| 422 | pages[<pageIndex>].button[<buttonIndex>] | Button has the same row and position as another button |
| 500 | internal_error | <Unspecified> |