Pihole does not stay disabled after API call to api.php

Please follow the below template, it will help us to help you!

Expected Behaviour:

Calls to /admin/api.php should keep Pi-hole disabled for the allotted time specified in the disable parameter.

Actual Behaviour:

Pi-hole will stay disabled for only a few seconds and then bounce right back up to "active" again. I am passing durations of 500 seconds through. This only seems to be the case when I make calls through the /api.php page. Disabling Pi-hole through the /admin webpage works as expected and will stay down for the selected time.

Debug Token:

z16p4ywg0r

What exactly are you doing to make calls to api.php?

I am making GET requests using Postman. It is not isolated to request made through Postman though.

Have you compared the requests you make with the ones the web interface makes? There must be some difference.

The only difference I can see is that the Web Interface is using it's own API key that is different from the only listed on /admin/scripts/pi-hole/php/api_token.php. I tried using that web interface key instead but any calls using it outside the web interface are rejected.

Updated with new debug token.

Is there anything else I can do to figure out what is going on or would it be better to wait for the new Rust REST API to launch?

Does your call look like the one here, but with an integer assigned to the disable parameter?

Currently using (minus the API key),

http://pihole/admin/api.php?disable=500&auth=<apikey>

Seems to match. Am I missing something? :thinking:

If you're doing that via the command line, make sure to quote the URL. Bash may be doing strange things with the & character (and possibly others).

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.