friimaind / pi-hole-droid

Pi-hole Droid is an unofficial app that connects to your Pi-hole to show charts and statistics.
Apache License 2.0
125 stars 16 forks source link

Pi-hole API will change at some point #7

Closed DL6ER closed 7 years ago

DL6ER commented 7 years ago

The API answers will change in the near future. Please have a look at https://github.com/pi-hole/AdminLTE/pull/408

We can add something like api.php?version which will either respond with PHP or FTL if you like.

friimaind commented 7 years ago

Yes, that could be great thank you.

I will obviously adapt my app to use the new API version when it will be available.

DL6ER commented 7 years ago

http://pi.hole/admin/api.php?type

Currently:

[]

FTL-integration branch:

{"version":"FTL"}

FTL-integration branch, FTL not running (fallback mode):

{"version":"PHP"}

https://github.com/pi-hole/AdminLTE/commit/e3d791abb65c1a4634a8b6eccc6af20753d4e0fa

DL6ER commented 7 years ago

Have a look at

https://discourse.pi-hole.net/t/pi-hole-api/1863

DL6ER commented 7 years ago

As of web v2.5 you can already use these keywords for detecting what to do:

http://pi.hole/admin/api.php?version -> {"version":2} http://pi.hole/admin/api.php?version&type -> {"type":"PHP","version":2}

etc.