dpv46227 2019-03-04 09:42
浏览 42

Prestashop员工通过webservice登录

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!!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序