I’m trying to schedule a job which runs periodically and queries the events API. I have everything up and running but I just don’t get any data returned. Here is what happens.
I query for all unarchived projects for our customer, this returns successfully. I iterate over the projects and call the endpoint with the project id, i.e. /events?resource=14321. I receive a 412 response code and get the sync token from the response. This token always seems to end with a “:0”. I stored the token and about half an hour later, I run the same query but this time I’m including the sync token, i.e. /events?resource=14321&sync=1231232313:0. I’m always getting a 200 response without any data, something like
Since the sync token has changed, I store the new token and the cycle continues from there, with the token incrementing after every call for the projects events endpoint. The problem I’m having is that this code has been running for 24 hours and every project returns an empty data array, and I know people are doing things in the application. Am I doing something wrong here? There don’t seem to be errors other than the expected 412 the first time I call this code.
I also tried doing the same thing for tasks, and the same empty data array is being returned.