I'm trying to log in via web service into a Prestashop site. I'm trying to code a utility for my web application in PHP to be able to post messages through my application with a user for my application created in the PrestaShop site using the AdminCustomerThreads controller, but I don't know how to do it properly because it needs a token (I can wonder it's a token generated when you log in). I've tried to login with this code
$webService = new PrestaShopWebservice(my_prestashop_site,my_webservice_key, true);
$password = md5(my_password);
$opt = array(
'resource' => 'employees',
'filter[email]' => '[email@domain.com]',
'filter[passwd]' => '['.$password.']',
'display' => 'full',
);
$xml = $webService->get($opt);
I'm using the PrestaShop Webservice library for php here.
When I execute this code I PrestaShop Web Services returns to me a 403 error. I've looked at PrestaShop database table for employees to check if my password is correct, and all seems correct.
I would know how to log in properly as an employee and how could I use the AdminCustomerThreads controller to post a custom message to my customers through my PrestaShop employee account.
If it helps, I have my webservice enabled, but my CGI mode for PHP is disabled, for now, I've made operations on PrestaShop throught my app, and it worked without activating CGI.
I'm using Laravel 5.5.
Thanks to all!!