Sugar REST API filter for data records that were created after a certain date.

Hello,

In a request to the Sugar API, I would like to filter for data records that were created after a certain date.
According to the API documentation, this should work with $gt.

However, my filter:

?filter=[{"date_modified":{"$gt"2024-03-06T16:56:16+01:00":""}}]

returns the error "invalid parameter".


What is the correct syntax? Can anyone help?

Thanks

Steffen

Parents Reply
  • Steffen,

    You may want to test that thoroughly. I seem to recall that matching a datetime against a date can have unexpected results. I believe that the date may actually append "12:00:00" before the comparison, so the $gt filter may match for times after midday GMT on the day provided. So you may get extras or may miss some expected ones where the date_entered time is before 12:00:00.

    Or that may have been an old bug that is fixed Slight smile

    All-in-all I prefer to match a datetime field against a full datetime string to make sure I am getting what I want.

    Thanks,

    JH.

Children
No Data