Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Accepted Solution

Tracking changes over time via API?

Posts: 3
2871     1
Newbie question, apologies if it's been discussed before. I searched the archive and looked at API doc before asking but did not come up with suitable answers.
Is there a recommended way of tracking changes via REST API? I'm looking at a use case where I want to track any records (assume 'hosts') that have a particular extended attribute. 
My current (possibly naive) approach is to do a while loop, searching by attribute, then sleep for x seconds. I can see this being inefficient in that the search will yield all records that match, regardless of when they were last changed.
Is there a better way to do this? Is there way to search with a "if modified since" parameter?

Re: Tracking changes over time via API?

Posts: 133
2871     1

To my knowledge the modification time for items such as DNS records, etc., is not exposed via any API, and thus there is no way in the API to do the equivalent of a "last modified since" query. (There are existing Requests for Enhancement filed in relation to this capability, including RFE-161, RFE-3245, RFE-4487, and RFE-6463. I suggest you ask your account team to track the progress of these and add supportive comments.)


Other than polling using repeated API calls, the only other approach I can think of right now is to use the audit log: Have the audit log be directed into the syslog and the syslog sent to the server where your API application is running. The application can then inspect incoming audit log records to try to determine if a relevant change might have occurred, and you can issue an API call only when you think there's a possible change.


(The audit log entry contains information on what type of item has been changed, the name of the modified item itself, and the before and after values. So alternatively you could use the audit log to build up a database of changes, and use API calls only to double-check the information.)




Showing results for 
Search instead for 
Do you mean 

Recommended for You