Modifiedsince parameter for synchronization purposes

Hello, everyone. I am currently in the process of creating an OCM synchronization engine with my database. And I am trying to solve the problem of synchronizing only updated data for a period of time. I found @Christopher’s post (Max number of results - #6 by Christopher) where he writes that it is possible use the modifiedsince parameter for this. Since I didn’t find this parameter in the documentation, I assume it must be in the Unix timestamp format. But the problem is that I’m not sure this filter works. For example, when I set a date close to the current date, I expect that the response will contain only data updated after that date. For example, for the value of the parameter modifiedsince=1682899200 (2023-05-01T00:00:00Z), I received the data with “dateLastStatusUpdate”: “2023-04-26T10:06:00Z” or “dateLastStatusUpdate”: "2022-08-12T06:29:00Z”. I would be grateful for an answer and advice on how to solve this problem.

Hi, the parameter exists for the internal sync process we used to use for our API mirrors: ocm-system/API/OCM.Net/OCM.API.Worker at master · openchargemap/ocm-system · GitHub

It is parsed as a datetime using .net DateTime.ToString("s", CultureInfo.InvariantCulture) so it expects a UTC date in the form 2021-03-19T06:49:11

I would use the maximum DateLastStatusUpdate you have and subtract 10 mins (for example) to ensure you’re capturing the latest changes.

You also have to refresh the core reference data each time (operators, connection type etc)

I really appreciate your response @Christopher. I tested the modifiedsince parameter and it works. My request looks like this.

curl --request GET
–url ‘https://api.openchargemap.io/v3/poi?key=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&countrycode=DE&output=json&client=open-charge-map-backend&camelcase=true&verbose=false&modifiedsince=2023-05-05T00%3A00%3A00Z
–output ‘openchargemap-poi-modifiedsince-de.json’

I hope it will also help other developers.

1 Like