{"_id":"57fcc4870312b20e00ac650f","__v":0,"project":"5435687035740020002a1c04","version":{"_id":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","__v":1,"createdAt":"2016-10-11T10:52:54.637Z","releaseDate":"2016-10-11T10:52:54.637Z","categories":["57fcc4860312b20e00ac64c1","57fcc4860312b20e00ac64c2","57fcc4860312b20e00ac64c3","57fcc4860312b20e00ac64c4","57fcc4860312b20e00ac64c5","57fcc4860312b20e00ac64c6","57fcc4860312b20e00ac64c7","57fcc4860312b20e00ac64c8","57fcc4860312b20e00ac64c9","57fcc4860312b20e00ac64ca","57fcc4860312b20e00ac64cb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"[APP-1265], [APP-1035]","version_clean":"5.2.0","version":"5.2"},"category":{"_id":"57fcc4860312b20e00ac64ca","version":"57fcc4860312b20e00ac64c0","__v":0,"project":"5435687035740020002a1c04","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-30T22:39:02.374Z","from_sync":false,"order":9,"slug":"flow-data-structures","title":"Flow Data Structures"},"user":"5435682035740020002a1c01","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-01T21:30:47.571Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Documentation Format\n\nTelemetryTV flows data structures are denoted in JSON format as the TelemetryTV API speaks JSON. \n\nThe documentation in this section provides a series of properties that represent the JSON object as expected by metrics for a Telemetry Flow.   \n\nFor instance, a number flow has a number parameter that is an object that has a value, type, and color and expects a JSON structure at a minimum like the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"number\\\": {\\n        \\\"value\\\": 23,\\n        \\\"type\\\": \\\"percent\\\",\\n        \\\"color\\\": \\\"green\\\"\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n# Shared Structure\n\nAll flows share some common flow properties.   All flows also have their own properties that are specific to that type of flow. \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Notes\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Comments\",\n    \"0-0\": \"expires_at\",\n    \"0-1\": \"\",\n    \"0-2\": \"timestamp\",\n    \"0-3\": \"This is a UNIX timestamp in seconds, after which the flow data will expire and the display will blank the data and show expired.\",\n    \"1-0\": \"opacity\",\n    \"1-1\": \"min = 0, max = 1\",\n    \"1-2\": \"float\",\n    \"1-3\": \"The alpha value of the widget as a whole.\",\n    \"2-0\": \"items\",\n    \"2-1\": \"\",\n    \"2-3\": \"An optional array that allows multiple sub-objects to be defined.\",\n    \"2-2\": \"array\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n# Items Array\n\nEach flow has an optional items array in its structure.  The items array allows you add multiple sub objects for some (not all) flow variants. \n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Do Not Interchange Items and Flat Data\",\n  \"body\": \"Do not interchangeably go from a flat data structure to an items array for a flow.   This will cause data merging issues and is a current limitation of the Telemetry API.  If you need to change be sure to delete the flow and add a new one first. \\n\\nWe will be addressing this issue in a future API revision.\"\n}\n[/block]\nFor instance for a number flow you could have it show two numbers with 23 and 77 by specifying:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"items\\\": [\\n        {\\n            \\\"number\\\": {\\n                \\\"value\\\": 23,\\n                \\\"type\\\": \\\"percent\\\",\\n                \\\"color\\\": \\\"green\\\"\\n            }\\n        },\\n        {\\n            \\\"number\\\": {\\n                \\\"value\\\": 77,\\n                \\\"type\\\": \\\"percent\\\",\\n                \\\"color\\\": \\\"red\\\"\\n            }\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe following flow variants support an items array:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Variant\",\n    \"0-0\": \"Gauge\",\n    \"1-0\": \"Icon\",\n    \"2-0\": \"Number\"\n  },\n  \"cols\": 1,\n  \"rows\": 3\n}\n[/block]","excerpt":"","slug":"common-properties","type":"basic","title":"Common Properties"}
# Documentation Format TelemetryTV flows data structures are denoted in JSON format as the TelemetryTV API speaks JSON. The documentation in this section provides a series of properties that represent the JSON object as expected by metrics for a Telemetry Flow. For instance, a number flow has a number parameter that is an object that has a value, type, and color and expects a JSON structure at a minimum like the following: [block:code] { "codes": [ { "code": "{\n \"number\": {\n \"value\": 23,\n \"type\": \"percent\",\n \"color\": \"green\"\n }\n}", "language": "json" } ] } [/block] # Shared Structure All flows share some common flow properties. All flows also have their own properties that are specific to that type of flow. [block:parameters] { "data": { "h-0": "Property", "h-1": "Notes", "h-2": "Type", "h-3": "Comments", "0-0": "expires_at", "0-1": "", "0-2": "timestamp", "0-3": "This is a UNIX timestamp in seconds, after which the flow data will expire and the display will blank the data and show expired.", "1-0": "opacity", "1-1": "min = 0, max = 1", "1-2": "float", "1-3": "The alpha value of the widget as a whole.", "2-0": "items", "2-1": "", "2-3": "An optional array that allows multiple sub-objects to be defined.", "2-2": "array" }, "cols": 4, "rows": 3 } [/block] # Items Array Each flow has an optional items array in its structure. The items array allows you add multiple sub objects for some (not all) flow variants. [block:callout] { "type": "danger", "title": "Do Not Interchange Items and Flat Data", "body": "Do not interchangeably go from a flat data structure to an items array for a flow. This will cause data merging issues and is a current limitation of the Telemetry API. If you need to change be sure to delete the flow and add a new one first. \n\nWe will be addressing this issue in a future API revision." } [/block] For instance for a number flow you could have it show two numbers with 23 and 77 by specifying: [block:code] { "codes": [ { "code": "{\n \"items\": [\n {\n \"number\": {\n \"value\": 23,\n \"type\": \"percent\",\n \"color\": \"green\"\n }\n },\n {\n \"number\": {\n \"value\": 77,\n \"type\": \"percent\",\n \"color\": \"red\"\n }\n }\n ]\n}", "language": "json" } ] } [/block] The following flow variants support an items array: [block:parameters] { "data": { "h-0": "Variant", "0-0": "Gauge", "1-0": "Icon", "2-0": "Number" }, "cols": 1, "rows": 3 } [/block]