Prestashop Webservice Api Login

1.3k views Asked by At

Now, i have search whole web, find some topics but no solution.

My version is Prestashop 1.6.0.11, PHP version 5.6.36, Enable CGI mode for PHP enabled/disabled doesn't matter

but the files are similar with latest version..

The problem is domain.com/api is not working with just submitting api key. it is just working by using domain/api?ws_key=YOUR_KEY or another version [email protected] etc..

But i must use a web application which needs domain name and api key, so other solutions are not suitable for me. it is working at localhost by using just api, (same version and database and files) it means it is related with hosting but i couldn't find any error, made config files error log True, i try to do just view(get) . I asked them, but what is the question ? so no clear answer.

what can i do ? any idea ? any way ?

htaccess is

RewriteEngine on
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

i read this , same.. https://www.prestashop.com/forums/topic/430312-presta-api-keep-asking-for-username-password-authentication-required/

1

There are 1 answers

1
Oriol Piera On

Just create an .htaccess within webservice folder with:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>