alextoft / sureflap

Basic PHP Examples for SureFlap API (IoT cat flap)
73 stars 17 forks source link

Query "Get Report" #11

Closed andreas0087 closed 5 years ago

andreas0087 commented 5 years ago

Is it possible to provide a query to get the reports. That would be very great!

2019-05-23_235816

hdurdle commented 5 years ago

Everything you need is exposed in the API on the surepetcare.io site. In this case you need to query: https://app.api.surehub.io/api/pet/<your pet ID>/position/summary/v2?from=2018-11-24&to=2019-05-24 put your pet ID and the dates you want, you'll get back a json object with dates and movements.

You should be able to adapt any of the examples already in the repository to do this.

andreas0087 commented 5 years ago

Hi "hdurdle",

thank you very much for your support! I used this query and got a list of all movements. Thanks!

I've one more question:

Is there's a way (query) to remove a movement from the surepetcare database? Or do change it?

hdurdle commented 5 years ago

If there is, I haven't seen it exposed in any of their UI. The fact that the mechanism to get a movement is to retrieve a whole group of them from a /summary endpoint, and not a /movement endpoint would indicate it doesn't exist as a discrete object you can query.

andreas0087 commented 5 years ago

Ok I understand. Trank you very much for your Support.