{"_id":"56cf4ede8acacb1300814890","category":{"_id":"56c35c57c0c4630d004e8650","version":"56c35c56c0c4630d004e864f","__v":17,"pages":["56c35c58c0c4630d004e8652","56c38f9c2d97560d00e23cb8","56c39b11e1e4190d003429b0","56c3a90c28bd680d005e7aa3","56c7b98a8bf67e0d0073477a","56c7b9d7379b311700ed8fe1","56c7bcc55652c217008e0923","56c7bee8606ee717003c4769","56cf423f8629f91300fd9779","56cf45b944c5700b0095c175","56cf4709287eb20b009f9eec","56cf49208acacb1300814884","56cf4c4c287eb20b009f9f01","56cf4d968629f91300fd9797","56cf4ede8acacb1300814890","56cf520b8629f91300fd97a9","56cf52d5287eb20b009f9f12"],"project":"56c35c56c0c4630d004e864c","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-16T17:28:55.483Z","from_sync":false,"order":0,"slug":"documentation","title":"Buzz API Overview"},"githubsync":"","version":{"_id":"56c35c56c0c4630d004e864f","project":"56c35c56c0c4630d004e864c","__v":8,"createdAt":"2016-02-16T17:28:54.864Z","releaseDate":"2016-02-16T17:28:54.864Z","categories":["56c35c57c0c4630d004e8650","56c7b9e5379b311700ed8fe3","56c7bab4606ee717003c4766","56c7bb3613e5400d001e8cbd","56cf3f5a5267d70b00494c4b","56cf3f866c5d7a13005ee894","56fd3956caad892200847bce","599da256e7742b002588bb02"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.5.0","version":"0.5"},"__v":5,"user":"56c39c05bc41330d009f25d7","parentDoc":null,"project":"56c35c56c0c4630d004e864c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-25T18:58:38.805Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":8,"body":"Buzz supports filtering of `GET` requests and reporting `POST` request using date ranges and special date syntax. Note: All dates in Buzz are stored in Eastern Standard Time (EST) and are in the format `YYYY-MM-DD HH:MM:SS`.\n\nExamples of Date Range GET Request\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d  '{\\\"create_date\\\":\\\">2015-01-01\\\"}'\\n curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d  '{\\\"create_date\\\":\\\">2015-01-01 13:15:00\\\"}'\\n curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d  '{\\\"create_date\\\":\\\">2015-01-01 13:15:00&&<=2015-05-31\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"\\\"Magic\\\" Date Requests\"\n}\n[/block]\nA number of built-in \"magic\" strings may be used when filtering by a date field. These fields are calculated by Buzz when the query is executed, so the dates included are relative to the current date and time. These should be used as a string modifying the date field in the request, without modifiers like \">\",\"<\", \"!\".\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Magic String\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"`yesterday`\",\n    \"0-0\": \"`today`\",\n    \"0-1\": \"Since previous midnight\",\n    \"3-0\": \"`this_week`\",\n    \"3-1\": \"Since midnight the previous Sunday\",\n    \"4-0\": \"`last_week`\",\n    \"5-0\": \"`this_year`\",\n    \"5-1\": \"Since midnight January 1st\",\n    \"6-0\": \"`last_year`\",\n    \"7-0\": \"`this_month`\",\n    \"7-1\": \"Since midnight the first of the current month\",\n    \"8-0\": \"`last_month`\",\n    \"9-0\": \"`quarter_to_date`\",\n    \"10-0\": \"`last_7_days`\",\n    \"10-1\": \"From midnight 7 days ago to the present\",\n    \"12-0\": \"`last_30_days`\",\n    \"13-0\": \"`last_90_days`\",\n    \"14-0\": \"`last_365_days`\",\n    \"2-0\": \"`last_24_hours`\",\n    \"2-1\": \"Last 24 hours (as opposed to `today`, which is from midnight on)\",\n    \"15-0\": \"`past`\",\n    \"16-0\": \"`future`\",\n    \"15-1\": \"Any date in the past. Useful for Buzz queries against `end_date` and similar fields.\",\n    \"16-1\": \"Any date in the future. Useful for Buzz queries against `end_date` and similar fields\",\n    \"11-0\": \"`last_14_days`\",\n    \"11-1\": \"From midnight 14 days ago to the present\"\n  },\n  \"cols\": 2,\n  \"rows\": 17\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Example of date requests with magic fields\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d '{\\\"create_date\\\":\\\"today\\\"}'\\ncurl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d '{\\\"create_date\\\":\\\"this_month\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"date-filtering","type":"endpoint","title":"Date Filtering on GET"}

getDate Filtering on GET


Buzz supports filtering of `GET` requests and reporting `POST` request using date ranges and special date syntax. Note: All dates in Buzz are stored in Eastern Standard Time (EST) and are in the format `YYYY-MM-DD HH:MM:SS`. Examples of Date Range GET Request [block:code] { "codes": [ { "code": " curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"create_date\":\">2015-01-01\"}'\n curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"create_date\":\">2015-01-01 13:15:00\"}'\n curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"create_date\":\">2015-01-01 13:15:00&&<=2015-05-31\"}'", "language": "curl" } ] } [/block] [block:api-header] { "type": "basic", "title": "\"Magic\" Date Requests" } [/block] A number of built-in "magic" strings may be used when filtering by a date field. These fields are calculated by Buzz when the query is executed, so the dates included are relative to the current date and time. These should be used as a string modifying the date field in the request, without modifiers like ">","<", "!". [block:parameters] { "data": { "h-0": "Magic String", "h-1": "Description", "1-0": "`yesterday`", "0-0": "`today`", "0-1": "Since previous midnight", "3-0": "`this_week`", "3-1": "Since midnight the previous Sunday", "4-0": "`last_week`", "5-0": "`this_year`", "5-1": "Since midnight January 1st", "6-0": "`last_year`", "7-0": "`this_month`", "7-1": "Since midnight the first of the current month", "8-0": "`last_month`", "9-0": "`quarter_to_date`", "10-0": "`last_7_days`", "10-1": "From midnight 7 days ago to the present", "12-0": "`last_30_days`", "13-0": "`last_90_days`", "14-0": "`last_365_days`", "2-0": "`last_24_hours`", "2-1": "Last 24 hours (as opposed to `today`, which is from midnight on)", "15-0": "`past`", "16-0": "`future`", "15-1": "Any date in the past. Useful for Buzz queries against `end_date` and similar fields.", "16-1": "Any date in the future. Useful for Buzz queries against `end_date` and similar fields", "11-0": "`last_14_days`", "11-1": "From midnight 14 days ago to the present" }, "cols": 2, "rows": 17 } [/block] [block:api-header] { "type": "get", "title": "Example of date requests with magic fields" } [/block] [block:code] { "codes": [ { "code": "curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"create_date\":\"today\"}'\ncurl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"create_date\":\"this_month\"}'", "language": "curl" } ] } [/block]