{"_id":"56b8c7f338b1070d00289219","__v":9,"project":"569f9cf6650e1d1900f96b5b","user":"5582e90181672a3900bb4fc7","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"},"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":"","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-08T16:53:07.423Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"URLs are valid for only 15 minutes after generation.\",\n  \"title\": \"Note:\"\n}\n[/block]\n## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>\\n    \\\"type\\\": company | domain,\\n    \\\"object\\\": <name of the company or domain>, \\n    \\\"date\\\": <stats period from stats_list>\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for stats_snapshot\"\n}\n[/block]\nThe following fields can be used in the **stats_snapshot** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"date\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"The date for which you want to see statistics, in the format YYYY-MM. Available periods can be retrieved by using the [stats_list](https://api-opensrs-email.readme.io/v1.0/docs/stats_list?bypass=8272e34bb5) method.\",\n    \"1-0\": \"object\",\n    \"1-1\": \"Required\",\n    \"1-2\": \"The name of the company or domain\",\n    \"2-0\": \"type\",\n    \"2-1\": \"Required\",\n    \"2-2\": \"The type of entity for which you want to see statistics.\\n\\nAllowed values are **company** or **domain**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for stats_snapshot\"\n}\n[/block]\nThe following fields can be used in the **stats_snapshot**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\": \"snapshot\",\n    \"2-1\": \"Returned if **success = true**\",\n    \"2-2\": \"The URL from which you can download the stats for the specified period.\",\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_snapshot\"\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  \\\"object\\\": \\\"example.com\\\",\\n  \\\"type\\\": \\\"domain\\\",\\n  \\\"date\\\": \\\"2010-11\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"success\\\": true,\\n\\t\\\"snapshot\\\":\\n\\\"https://admin.a.hostedemail.com/api/oma_file/get?type=snapshot&id=exam ple.com%3Adomain%3A2010- 11&user=marlin%40example.adm&token=07202b1a7af002692018b60a22d82afa\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **stats_snapshot** method generates a URL from which a stats snapshot can be downloaded.","slug":"stats_snapshot","type":"basic","title":"stats_snapshot"}

stats_snapshot

The **stats_snapshot** method generates a URL from which a stats snapshot can be downloaded.

[block:callout] { "type": "info", "body": "URLs are valid for only 15 minutes after generation.", "title": "Note:" } [/block] ## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>\n \"type\": company | domain,\n \"object\": <name of the company or domain>, \n \"date\": <stats period from stats_list>\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for stats_snapshot" } [/block] The following fields can be used in the **stats_snapshot** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "date", "0-1": "Required", "0-2": "The date for which you want to see statistics, in the format YYYY-MM. Available periods can be retrieved by using the [stats_list](https://api-opensrs-email.readme.io/v1.0/docs/stats_list?bypass=8272e34bb5) method.", "1-0": "object", "1-1": "Required", "1-2": "The name of the company or domain", "2-0": "type", "2-1": "Required", "2-2": "The type of entity for which you want to see statistics.\n\nAllowed values are **company** or **domain**." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for stats_snapshot" } [/block] The following fields can be used in the **stats_snapshot**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": "snapshot", "2-1": "Returned if **success = true**", "2-2": "The URL from which you can download the stats for the specified period.", "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_snapshot" } [/block] **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"object\": \"example.com\",\n \"type\": \"domain\",\n \"date\": \"2010-11\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n\t\"success\": true,\n\t\"snapshot\":\n\"https://admin.a.hostedemail.com/api/oma_file/get?type=snapshot&id=exam ple.com%3Adomain%3A2010- 11&user=marlin%40example.adm&token=07202b1a7af002692018b60a22d82afa\"\n}", "language": "perl", "name": " " } ] } [/block]