Home > Software design >  detect changes in an API response
detect changes in an API response

Time:11-03

Guys I have the same problem in here which as you can see it's not solved : Best way to detect changes in an API response and I really need to figure how to do this

CodePudding user response:

The solution proposed in the question you linked really is your best bet.

You should send a request to the API at a fixed interval and if the response changes then compare the differences and send a notification based on those differences.

Be sure to read the comments on this answer for further thoughts on this.

CodePudding user response:

I'll double that the solution proposed in the question you linked is the ideal way to go.

If you are wondering how to detect there are any changes in the API response, it depends on the response body format. For example, Jackson is pretty good at the deep comparison of JSON documents.

If the API response has the same overall structure (e.g. ordering of the elements are same, consistent field naming), you can compute a hash from the response body, store it and later compare hashes.

  • Related