{"_id":"56b8c55d38b1070d00289210","category":{"_id":"56b8c4d938b1070d0028920f","project":"569f9cf6650e1d1900f96b5b","version":"569f9cf6650e1d1900f96b5e","pages":["56b8c5018a9e7c0d004bb189","56b8c55d38b1070d00289210","56b8c7f338b1070d00289219"],"__v":3,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-08T16:39:53.889Z","from_sync":false,"order":9,"slug":"stats-methods","title":"Stats methods"},"githubsync":"","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":7,"project":"569f9cf6650e1d1900f96b5b","user":"5582e90181672a3900bb4fc7","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-08T16:42:05.554Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"The **stats_list** method retrieves a list of available stats periods for use with the [stats_snapshot](https://api-opensrs-email.readme.io/v1.0/docs/stats_snapshot?bypass=8272e34bb5) method.\n\n## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for stats_list\"\n}\n[/block]\nThe following fields may be returned in response to the **stats_list** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"error\",\n    \"0-1\": \"Returned if **success = false**\",\n    \"0-2\": \"A text string that explains the error.\",\n    \"1-0\": \"error_number\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A number that represents the error.\",\n    \"2-0\": \"snapshots\",\n    \"2-1\": \"Returned if **success = true**\",\n    \"2-2\": \"The list of snapshot periods. \\n\\nAllowed values are:\\n\\n  * **month**—List of monthy snapshots, in the format YYYY-MM.\\n\\n  * **week**—List of weekly snapshots, in the format YYYYMMDD-YYYYMMDD.\\n\\n  * **day**—List of daily snapshots, in the format, YYYYMMDD.\",\n    \"3-0\": \"success\",\n    \"3-1\": \"Always returned\",\n    \"3-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for stats_list\"\n}\n[/block]\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin:::at:::example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"snapshots\\\": {\\n    \\\"month\\\": [\\n      \\\"2011-01\\\",\\n      \\\"2011-02\\\",\\n      \\\"2011-03\\\",\\n      \\\"2011-04\\\",\\n      \\\"2011-05\\\",\\n      \\\"2011-06\\\"\\n\\t\\t],\\n  \\t\\\"week\\\": [\\n      \\\"20110103-20110109\\\",\\n      \\\"20110110-20110116\\\",\\n      \\\"20110117-20110123\\\",\\n      \\\"20110124-20110130\\\",\\n      \\\"20110131-20110206\\\",\\n      \\\"20110207-20110213\\\",\\n      \\\"20110214-20110220\\\",\\n      \\\"20110221-20110227\\\",\\n...\\n      \\\"20110620-20110626\\\",\\n      \\\"20110627-20110703\\\",\\n    ],\\n    \\\"day\\\": [\\n     \\t\\\"20110111\\\",\\n      \\\"20110107\\\",\\n      \\\"20110112\\\",\\n      \\\"20100314\\\",\\n      \\\"20110113\\\",\\n      \\\"20110114\\\",\\n      \\\"20110115\\\",\\n...\\n      \\\"20110629\\\",\\n      \\\"20110630\\\",\\n    ]\\n\\t} \\n}\\n      \",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"stats_list","type":"basic","title":"stats_list"}
The **stats_list** method retrieves a list of available stats periods for use with the [stats_snapshot](https://api-opensrs-email.readme.io/v1.0/docs/stats_snapshot?bypass=8272e34bb5) method. ## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Response fields for stats_list" } [/block] The following fields may be returned in response to the **stats_list** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "error", "0-1": "Returned if **success = false**", "0-2": "A text string that explains the error.", "1-0": "error_number", "1-1": "Returned if **success = false**", "1-2": "A number that represents the error.", "2-0": "snapshots", "2-1": "Returned if **success = true**", "2-2": "The list of snapshot periods. \n\nAllowed values are:\n\n * **month**—List of monthy snapshots, in the format YYYY-MM.\n\n * **week**—List of weekly snapshots, in the format YYYYMMDD-YYYYMMDD.\n\n * **day**—List of daily snapshots, in the format, YYYYMMDD.", "3-0": "success", "3-1": "Always returned", "3-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**." }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Examples for stats_list" } [/block] **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"snapshots\": {\n \"month\": [\n \"2011-01\",\n \"2011-02\",\n \"2011-03\",\n \"2011-04\",\n \"2011-05\",\n \"2011-06\"\n\t\t],\n \t\"week\": [\n \"20110103-20110109\",\n \"20110110-20110116\",\n \"20110117-20110123\",\n \"20110124-20110130\",\n \"20110131-20110206\",\n \"20110207-20110213\",\n \"20110214-20110220\",\n \"20110221-20110227\",\n...\n \"20110620-20110626\",\n \"20110627-20110703\",\n ],\n \"day\": [\n \t\"20110111\",\n \"20110107\",\n \"20110112\",\n \"20100314\",\n \"20110113\",\n \"20110114\",\n \"20110115\",\n...\n \"20110629\",\n \"20110630\",\n ]\n\t} \n}\n ", "language": "perl", "name": " " } ] } [/block]