{"_id":"57dbe16ab68b500e00d3739b","__v":0,"category":{"_id":"5540ce1c31827a0d007ab1d0","version":"5540ce1c31827a0d007ab1cf","pages":["5540ce1d31827a0d007ab1d2","5540ff9dbb9e762d00f59557","554109205cf9682100d61b65","554109c35cf9682100d61b6b","55a635b6249a40190051d9a2","55bb5de0a8400c2d00873e19","55bb5f4174f10a0d002209a2","55bb607374f10a0d002209a6","55bb614f7313650d00c46e88","55bb61d8a8400c2d00873e20","55bb629874f10a0d002209aa","55bb6318a8400c2d00873e23","55bb63a07313650d00c46e8a","55d5dc84988e130d000b4110","5620b53d40e2c30d0002a848","567cfe57221af70d00fc5498","567d01fd221af70d00fc549c"],"project":"5540ce1b31827a0d007ab1cc","__v":17,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T12:27:08.888Z","from_sync":false,"order":1,"slug":"remote-api","title":"Remote API"},"user":"567bb6833241c20d00b730db","parentDoc":null,"version":{"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","__v":31,"createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"5540ce1b31827a0d007ab1cc","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-16T12:11:22.769Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":31,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Enterprise API\"\n}\n[/block]\nGets the statistics for the application.\n\nStatistic displays registered actions for the defined time frame for application, device or message.\n\nReports are automatically aggregated via the following rules:\nyearly > 1 year\nmonthly > 1 month\ndaily > 1 day\nhourly > 3 hours\nminutely in other cases\n\n**Actions:**\nApplication Level:  *open*, *install*\n\nDevice Level: *register*, *unregister* \n\nMessage level: *send*, *open* \n\nAll statistics objects has the same format:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"formatter\",\n    \"0-1\": \"string\",\n    \"0-2\": \"report scale: yearly, monthly, daily, hourly, minutely\",\n    \"1-0\": \"rows\",\n    \"1-1\": \"list\",\n    \"1-2\": \"report rows\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\nReport rows is an dictionary:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"count\",\n    \"0-1\": \"int\",\n    \"0-2\": \"count of registered actions\",\n    \"1-0\": \"action\",\n    \"1-1\": \"string\",\n    \"1-2\": \"registered action\",\n    \"2-0\": \"datetime\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Formatted date: Y-m-d H:i:s\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"IMPORTANT\",\n  \"body\": \"As every scheduled request, **/getAppStats** request requires an additional **/getResults** request\"\n}\n[/block]\n**Request body** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"h-3\": \"Mandatory\",\n    \"0-0\": \"applicaton\",\n    \"1-0\": \"auth\",\n    \"2-0\": \"datefrom\",\n    \"3-0\": \"dateto\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string\",\n    \"2-1\": \"string\",\n    \"3-1\": \"string\",\n    \"0-2\": \"Pushwoosh application code\",\n    \"1-2\": \"Pushwoosh API auth token\",\n    \"2-2\": \"Report start peroid date. Formatted date: Y-m-d H:i:s\",\n    \"3-2\": \"Report end peroid date. Formatted date: Y-m-d H:i:s\",\n    \"0-3\": \"yes\",\n    \"1-3\": \"yes\",\n    \"2-3\": \"yes\",\n    \"3-3\": \"yes\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n## Request \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"request\\\": {\\n                \\\"auth\\\": \\\"API_ACCESS_TOKEN\\\",\\n                \\\"application\\\": \\\"APPLICATION_CODE\\\",\\n                \\\"datefrom\\\": \\\"2016-07-15 00:11:22\\\",\\n                \\\"dateto\\\": \\\"2016-07-15 11:22:33\\\"\\n               }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Response body** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"request_id\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Scheduled request ID. Please check getResults method for more information\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n## Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"status_code\\\": 200,\\n    \\\"status_message\\\": \\\"OK\\\",\\n    \\\"response\\\": {\\n        \\\"request_id\\\": \\\"c93a202f439235f9adaaa06d651548ab\\\"\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Scheduled (/getResults) response body** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"applications\",\n    \"1-0\": \"devices\",\n    \"2-0\": \"messages\",\n    \"0-1\": \"dictionary\",\n    \"1-1\": \"dictionary\",\n    \"2-1\": \"dictionary\",\n    \"0-2\": \"statistics for applications\",\n    \"1-2\": \"statistics for devices\",\n    \"2-2\": \"statistics for messages\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"error\\\":{\\\"code\\\":0,\\\"message\\\":\\\"OK\\\"},\\\"json_data\\\":{\\\"applications\\\":{\\\"formatter\\\":\\\"hourly\\\",\\\"rows\\\":[{\\\"count\\\":0,\\\"action\\\":\\\"open\\\",\\\"datetime\\\":\\\"2013-06-06 00:00:00\\\"},...\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"getappstats","type":"basic","title":"/getAppStats"}
[block:callout] { "type": "success", "title": "Enterprise API" } [/block] Gets the statistics for the application. Statistic displays registered actions for the defined time frame for application, device or message. Reports are automatically aggregated via the following rules: yearly > 1 year monthly > 1 month daily > 1 day hourly > 3 hours minutely in other cases **Actions:** Application Level: *open*, *install* Device Level: *register*, *unregister* Message level: *send*, *open* All statistics objects has the same format: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "formatter", "0-1": "string", "0-2": "report scale: yearly, monthly, daily, hourly, minutely", "1-0": "rows", "1-1": "list", "1-2": "report rows" }, "cols": 3, "rows": 2 } [/block] Report rows is an dictionary: [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "count", "0-1": "int", "0-2": "count of registered actions", "1-0": "action", "1-1": "string", "1-2": "registered action", "2-0": "datetime", "2-1": "string", "2-2": "Formatted date: Y-m-d H:i:s" }, "cols": 3, "rows": 3 } [/block] [block:callout] { "type": "warning", "title": "IMPORTANT", "body": "As every scheduled request, **/getAppStats** request requires an additional **/getResults** request" } [/block] **Request body** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "h-3": "Mandatory", "0-0": "applicaton", "1-0": "auth", "2-0": "datefrom", "3-0": "dateto", "0-1": "string", "1-1": "string", "2-1": "string", "3-1": "string", "0-2": "Pushwoosh application code", "1-2": "Pushwoosh API auth token", "2-2": "Report start peroid date. Formatted date: Y-m-d H:i:s", "3-2": "Report end peroid date. Formatted date: Y-m-d H:i:s", "0-3": "yes", "1-3": "yes", "2-3": "yes", "3-3": "yes" }, "cols": 4, "rows": 4 } [/block] ## Request [block:code] { "codes": [ { "code": "{\n \"request\": {\n \"auth\": \"API_ACCESS_TOKEN\",\n \"application\": \"APPLICATION_CODE\",\n \"datefrom\": \"2016-07-15 00:11:22\",\n \"dateto\": \"2016-07-15 11:22:33\"\n }\n}", "language": "json" } ] } [/block] **Response body** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "request_id", "0-1": "string", "0-2": "Scheduled request ID. Please check getResults method for more information" }, "cols": 3, "rows": 1 } [/block] ## Response [block:code] { "codes": [ { "code": "{\n \"status_code\": 200,\n \"status_message\": \"OK\",\n \"response\": {\n \"request_id\": \"c93a202f439235f9adaaa06d651548ab\"\n }\n}", "language": "json" } ] } [/block] **Scheduled (/getResults) response body** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "applications", "1-0": "devices", "2-0": "messages", "0-1": "dictionary", "1-1": "dictionary", "2-1": "dictionary", "0-2": "statistics for applications", "1-2": "statistics for devices", "2-2": "statistics for messages" }, "cols": 3, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "{\"error\":{\"code\":0,\"message\":\"OK\"},\"json_data\":{\"applications\":{\"formatter\":\"hourly\",\"rows\":[{\"count\":0,\"action\":\"open\",\"datetime\":\"2013-06-06 00:00:00\"},...", "language": "json" } ] } [/block]