How to use CURL for querying the API with password?

Dear All,
I'm trying to retrieve data from the API as described in the docs. I can successfully run the following query based on the doc:
curl -X GET "http://pi.hole:80/api/auth" -H 'accept: application/json'
This is because it doesn't need a password (or auth token).

The next one also works:
curl -X POST "http://pi.hole:80/api/auth" -H 'accept: application/json' -H 'content-type: application/json' -d '{"password":"password"}'

But all the others, like this, don't work:
curl -X GET "http://pi.hole:80/api/history" -H 'accept: application/json'
Most likely, because no password was specified.

However, I don't know how to specify it. I tried it like this:
curl -X POST "http://192.168.123.3:80/api/history" -H 'accept: application/json' -H 'content-type: application/json' -d '{"password":"password"}'
. but it ends up in an error:
{"error":{"key":"not_found","message":"Not found","hint":"/api/history"},"took":0.00041508674621582031}

Anybody has any experience on how to specify the password in curl?

Thanks for any pointers!

I found the right steps to do just the above, here:

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