Forum

API --- Not found
 
Notifications
Clear all

API --- Not found

8 Posts
2 Users
0 Reactions
8,259 Views
 HAY
(@wisou)
Posts: 5
Active Member
Topic starter
 
[#4538]

Hi,

I'am trying to catch datas from API REST only GET for the moment.
.htaccess and .htpasswd files are OK
With this URL 'http://myserver/api', i see trace in projeqtor log after authentification and i see this message :

{"error":"invalid API query", "message":"Possible values are : GET ../api/{objectClass}/{objectId} ../api/{objectClass}/all ../api/{objectClass}/filter/{filterId} ../api/{objectClass}/search/criteria1/criteria2/... (criteria as sql where clause) ../api/{objectClass}/updated/{YYYYMMDDHHMNSS}/{YYYYMMDDHHMNSS} PUT ../api/{objectClass} with data containing json description of items POST ../api/{objectClass} with data containing json description of items DELETE ../api/{objectClass} with data containing json id of items"}

But if i'am trying with this url for exemple http://myserver/api/Project/All no authentification and only this message :

"Not Found
The requested URL /api/Project/All was not found on this server."

Can you help me please ?

Br
Wisou


 
Posted : 28 Jul 2017 19H03
(@babynus)
Posts: 14952
Member Admin
 

Is "http://myserver/" directly pointing to projeqtor web directory ? (so you have a virtualhost ?)

You must configure apache to allow overwrinting features from .htaccess for api folder.


 
Posted : 31 Jul 2017 13H20
(@babynus)
Posts: 14952
Member Admin
 

Also try http://myserver/api/Project/all


 
Posted : 31 Jul 2017 13H21
 HAY
(@wisou)
Posts: 5
Active Member
Topic starter
 

I try this "http://projeqtor.****.net/api/Project/All" but no result

Extract .htaccess in API folder

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1

AuthUserFile "/var/www/projeqtor/api/.htpasswd"
AuthName "ProjeQtOr"
AuthType Basic
require valid-user

Extract apache2.conf / 'www' contain Projeqtor :

Options Indexes FollowSymLinks
AllowOverride All
Require all granted

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#

Require all denied


 
Posted : 01 Aug 2017 14H07
(@babynus)
Posts: 14952
Member Admin
 

Config seem correct at first glance.

I try this "http://projeqtor.****.net/api/Project/All" but no result

it seems you have virtualhost.
Check its configuration.


 
Posted : 04 Aug 2017 2H23
(@babynus)
Posts: 14952
Member Admin
 

I try this "http://projeqtor.****.net/api/Project/All" but no result

What is not result ?
blank page ?
error ?
beautiful "no result" page ?
else ?


 
Posted : 04 Aug 2017 11H26
 HAY
(@wisou)
Posts: 5
Active Member
Topic starter
 

Hi,

My config for virtualhost seem OK but no result

ServerName projeqtor.****.net

## Vhost docroot
DocumentRoot "/var/www/projeqtor"

Allow from all
AllowOverride All

## Logging
ErrorLog "/var/log/apache2/projeqtor_error.log"
LogLevel warn
ServerSignature Off
CustomLog "/var/log/apache2/projeqtpor_access.log" combined


 
Posted : 08 Aug 2017 12H38
 HAY
(@wisou)
Posts: 5
Active Member
Topic starter
 

I found my problem...rewrite module don't enable
Thx for your help


 
Posted : 08 Aug 2017 12H53
Share:

Scroll to Top