-
-
Notifications
You must be signed in to change notification settings - Fork 289
[Bug]: API enabled and 404 not found #767
Description
Describe the problem
Good morning, I enabled the APIs as documented at: https://docs.poweradmin.org/configuration/api/
I'm attaching a configuration extract:
'api' => [
'enabled' => true, // Enable API functionality (including API keys)
'basic_auth_enabled' => false, // Enable HTTP Basic Authentication for public API endpoints
'log_requests' => true, // Log all API requests
'docs_enabled' => true, // Enable API documentation at /api/docs endpoint
making the call from the application or with curl (after configuring the API Keys inside the web console you get the error:
{"error":"Not Found","message":"The requested resource was not found","status":404}.
Analyzing the error.log and access.log file of Apache, we can see:
==> error.log <==
[Tue Sep 02 00:32:17.242684 2025] [php:notice] [pid 474:tid 474] [client XXX.XXX.XXX.XXX] Class \Poweradmin\Application\Controller\Api\v1\ZonesController not found
[Tue Sep 02 00:32:17.242707 2025] [php:notice] [pid 474:tid 474] [client XXX.XXX.XXX.XXX] #0 /var/www/poweradmin/index.php(68): Poweradmin\Application\Routing\BasicRouter->process()\n#1 {main}
==> access.log <==
2a01:4f8:2191:308d:b10:127:240:17 - - [02/Sep/2025:00:32:17 +0200] "GET /api/v1/zones HTTP/1.1" 404 414 "-" "curl/7.88.1"
The Apache configuration, as per the documentation, includes:
<Directory /var/www/poweradmin>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Steps to reproduce
Launch:
curl -H "X-API-Key: pwa_95d529f91615afaf3036fdc38cdccbbc3a4804e4d534e4100ffc010b6a7d1ec4" -H "Content-Type: application/json" https://dns.mydomain.com/api/v1/zones
Poweradmin version
4.0.1
Database
PostgreSQL
Additional information (optional)
No response