I am trying to set up a process to use the Extract Changes REST API for a hosted feature service that has "Keep track of changes to the data" enabled. I am finding, however, that the serverGen in the service JSON has not changed from the minServerGen. I know that the data in this layer is being created and updated daily. My understanding was that the serverGen should update any time changes are made to the features.
When I try to use this serverGen value to extract the changes, the status seems to just get stuck on "Pending", and never actually give me a result URL. I am thinking maybe it is trying to give me all the changes that have been made since the creation of this service and enablement of the track changes feature?
Am I not understanding how this feature/API work? Is there some other setting that I need in order for this to work correctly?
I managed to get a result back after waiting a few hours. It ended up being about 1.8 million lines of JSON with changes going back to September 2021 (303 days). Interestingly, the serverGen in the result JSON is much different than the serverGen displayed in the feature service JSON in my original post:
Is it possible that the feature service JSON isn't getting the correct value somehow? I'm still not sure I understand what exactly this value means and how I can use it to get just recent changes.
You might try this. Cleanup change tracking
Also, I ran into a bug that was logged. I received the server gens via webhook. My process called the status url from that webhook payload. The automation returned status of pending or failed every time, but the manual rest api queries with the same server gens showed a different status. That step is just step is just after getting the server gens.