REST API Filter for dates between

I am trying to use a GET Request to pull back records where the Created Date is between 2 dates, however I keep getting the following error:

"error": "invalid_parameter",
"error_message": "$between requires an array with two values."

my current request is as follows 

/rest/v10/Opportunities?filter[0][date_entered][$dateBetween]=[2018-07-01T00:00:00+10:00,2018-12-31T23:59:59+11:00]

Thanks in Advance

Parents
  • I know I am very late. And hopefully, you got some solution. The following solution is working for me. If anyone else having the same issue. then

    try this. It's working for me. 

    $t_start_date = '2021-03-15';

    $t_end_date = '2021-03-30';

    $module = 'Contacts';


    $url = '/' . $module . '?order_by=date_entered:DESC&filter[0][date_entered][$gte]=' . $t_start_date . '&filter[0][date_entered][$lte]=' . $t_end_date;
Reply
  • I know I am very late. And hopefully, you got some solution. The following solution is working for me. If anyone else having the same issue. then

    try this. It's working for me. 

    $t_start_date = '2021-03-15';

    $t_end_date = '2021-03-30';

    $module = 'Contacts';


    $url = '/' . $module . '?order_by=date_entered:DESC&filter[0][date_entered][$gte]=' . $t_start_date . '&filter[0][date_entered][$lte]=' . $t_end_date;
Children