{"action":"created","issue":{"url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/7623","repository_url":"https://api.github.com/repos/Dolibarr/dolibarr","labels_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/7623/labels{/name}","comments_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/7623/comments","events_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/7623/events","html_url":"https://github.com/Dolibarr/dolibarr/issues/7623","id":264912544,"number":7623,"title":"BUG:  Rest API Explorer empty on a fresh install on an hosted platform ","user":{"login":"bgenere","id":1235982,"avatar_url":"https://avatars1.githubusercontent.com/u/1235982?v=4","gravatar_id":"","url":"https://api.github.com/users/bgenere","html_url":"https://github.com/bgenere","followers_url":"https://api.github.com/users/bgenere/followers","following_url":"https://api.github.com/users/bgenere/following{/other_user}","gists_url":"https://api.github.com/users/bgenere/gists{/gist_id}","starred_url":"https://api.github.com/users/bgenere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgenere/subscriptions","organizations_url":"https://api.github.com/users/bgenere/orgs","repos_url":"https://api.github.com/users/bgenere/repos","events_url":"https://api.github.com/users/bgenere/events{/privacy}","received_events_url":"https://api.github.com/users/bgenere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-12T11:54:57Z","updated_at":"2017-10-22T12:17:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# Bug\r\nThis is the first time I am activating the Rest API.\r\nI have followed the documentation but the Explorer is empty. Even the login method does not show up.\r\nThere is no information about this issue in the documentation or any pre requisite needed.\r\nI have checked the Dolibarr Demo system to be sure what should be there, and I was able to use it.\r\nI would like to know what's wrong there. Is there anything to check ?\r\n\r\n## Environment\r\n- **Version**: 6.0.2 \r\n- **OS**: Linux chevre.o2switch.net 3.10.0-714.10.2.lve1.4.63.el7.x86_64\r\n- **Web server**: Apache \r\n- **PHP**: 7.0.24\r\n- **Database**: MySQL or MariaDB 5.5.5-10.0.32-MariaDB\r\n- **URL(s)**: https://dolibarrv6.encom1.fr/api/index.php/explorer\r\n\r\n## Expected and actual behavior\r\nUsing the URL I should at least see the login class.\r\nElse I get the following json\r\n{\"apiVersion\":\"1\",\"swaggerVersion\":\"1.2\",\"apis\":[],\"authorizations\":{\"apiKey\":{\"type\":\"apiKey\",\"passAs\":\"query\",\"keyname\":\"api_key\"}},\"info\":{\"title\":\"Restler API Explorer\",\"description\":\"Live API Documentation\",\"contact\":\"arul@luracast.com\",\"license\":\"LGPL-2.1\",\"licenseUrl\":\"https:\\/\\/www.gnu.org\\/licenses\\/old-licenses\\/lgpl-2.1.html\"}}\r\n\r\n## Steps to reproduce the behavior\r\nUse the above URL i.e  https://dolibarrv6.encom1.fr/api/index.php/explorer\r\nnothing displays.\r\n\r\n## [Attached files](https://help.github.com/articles/issue-attachments) \r\n[*Files*]\r\n[dolibarr.log](https://github.com/Dolibarr/dolibarr/files/1379182/dolibarr.log)\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/comments/338472946","html_url":"https://github.com/Dolibarr/dolibarr/issues/7623#issuecomment-338472946","issue_url":"https://api.github.com/repos/Dolibarr/dolibarr/issues/7623","id":338472946,"user":{"login":"eldy","id":883887,"avatar_url":"https://avatars2.githubusercontent.com/u/883887?v=4","gravatar_id":"","url":"https://api.github.com/users/eldy","html_url":"https://github.com/eldy","followers_url":"https://api.github.com/users/eldy/followers","following_url":"https://api.github.com/users/eldy/following{/other_user}","gists_url":"https://api.github.com/users/eldy/gists{/gist_id}","starred_url":"https://api.github.com/users/eldy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eldy/subscriptions","organizations_url":"https://api.github.com/users/eldy/orgs","repos_url":"https://api.github.com/users/eldy/repos","events_url":"https://api.github.com/users/eldy/events{/privacy}","received_events_url":"https://api.github.com/users/eldy/received_events","type":"User","site_admin":false},"created_at":"2017-10-22T12:17:02Z","updated_at":"2017-10-22T12:17:02Z","author_association":"OWNER","body":"The var_dump can't help.\r\nBut the dolibarr.log file show\r\n\r\n2017-10-12 13:50:32 INFO    176.137.26.90   --- Access to /api/index.php - action=, massaction=\r\n2017-10-12 13:50:32 INFO    176.137.26.90   --- End access to /api/index.php\r\n\r\nWe should have content between two lines that show the scanning of dolibarr dirs to find api files\r\nInto file htdocs/api/index.php, it seems we don't enter into this part of code:\r\n\r\n\r\n// Call Explorer file for all APIs definitions\r\nif (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' || $reg[2] == '/resources.json/root'))\r\n{\r\n    // Scan all API files to load them\r\n\r\n    $listofapis = array();\r\n\r\n    $modulesdir = dolGetModulesDirs();\r\n    foreach ($modulesdir as $dir)\r\n    {\r\n        // Search available module\r\n        dol_syslog(\"Scan directory \".$dir.\" for module descriptor to after search for API files\");\r\n\r\n\r\n\r\nWe should see the log   \"Scan directory...\"\r\n"}}
{"actor":{"display_login":"eldy"}}