I am trying to use API on MiaB. The documentation states that, if 2FA is present, “Authentication via a user:user_key pair is possible without the header being present.”.
Can anyone point me out on where the user_key is? I have tried the one in /var/lib/mailinabox but with no success.
Additionally, the examples in the API docs, in the login example, are providing CURL GET instead of CURL POST when accessing the /login endpoint.
The /var/lib/mailinabox/api.key is basically a blank check to do whatever you want; that is, every operation you do with that key is treated as an unspecified administrator.
However, this key isn’t exactly permanent, every time the management daemon restarts (the machine reboots or you run the setup), this key is re-generated. Thus, it’s only viable to use this key on applications that are already inside the box and that can read this file.