Date Filtering on GET
Buzz supports filtering of GET
requests and reporting POST
request using date ranges and special date syntax. Note: All dates read or written using the API in Buzz are in the Account timezone in the format YYYY-MM-DD HH:MM:SS
.
Examples of Date Range GET Request
curl -X GET "[host]/rest/advertiser" -b cookies.txt
-d '{"create_date":">2015-01-01"}'
curl -X GET "[host]/rest/advertiser" -b cookies.txt
-d '{"create_date":">2015-01-01 13:15:00"}'
curl -X GET "[host]/rest/advertiser" -b cookies.txt
-d '{"create_date":">2015-01-01 13:15:00&&<=2015-05-31"}'
"Magic" Date Requests
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 ">","<", "!".
Magic String | Description |
---|---|
today | Since previous midnight |
yesterday | |
last_24_hours | Last 24 hours (as opposed to today , which is from midnight on) |
this_week | Since midnight the previous Sunday |
last_week | |
this_year | Since midnight January 1st |
last_year | |
this_month | Since midnight the first of the current month |
last_month | |
quarter_to_date | |
last_7_days | From midnight 7 days ago to the present |
last_14_days | From midnight 14 days ago to the present |
last_30_days | |
last_90_days | |
last_365_days | |
past | Any date in the past. Useful for Buzz queries against end_date and similar fields. |
future | Any date in the future. Useful for Buzz queries against end_date and similar fields |
Example of date requests with magic fields
curl -X GET "[host]/rest/advertiser" -b cookies.txt
-d '{"create_date":"today"}'
curl -X GET "[host]/rest/advertiser" -b cookies.txt
-d '{"create_date":"this_month"}'
Updated over 4 years ago