Example of how to use date range in the Blog API REST Call

cos

#1

Hi,

I am calling the blogs API and would like to use the range functionality (for created date), the docs explain how to use the greater than when call API, just trying to find out how to use the range.

If a parameter supports a filter type of ‘gt’, that means you can append a double underscore to the parameter name to find all items greater than the specified value

Can anyone help with syntax for range please? Is a combination of __lt and __gt - have tried a number of combinations without success.

Thanks in advance,
Warren

PS> Have tried searching API docs and Forum without success


#2

Hi @warrenei warrenei,

When using the range filter, you’ll want to include two instances of the same query parameter. For example, if you were looking to make a request to get the blog posts between January 1st and August 20th, you’d make a request to the following URL:

api.hubapi.com/content/api/v2/blog-posts?hapikey=demo&updated__range=1483246800000&updated__range=1503201600000


#3

Thank you @Derek_Gervais !


#4

Can I use range filter to get modified companies and deals within provided time span?


#5

Hi @smarterme,

No, the range filter is currently only a feature of the blog post API.