On this weblog, we are going to discover ways to ship webservice key within the authorization header as an alternative of the URL.
Generally we’d like that we don’t need to present webservice key within the API URL & Prestashop sends ws_key with its worth within the URL. Examine this:
If we need to take away this from the URL, we have to ship this within the authorization header as Fundamental Auth. Please verify the beneath picture.
Additionally, there’s one other choice to handle webservice key privateness. You may set this ws_key immediately within the code to handle APIs.
For this, It’s essential save webservice key in a configuration key & then you may immediately entry this ws_key.
$wsKey = Configuration::get('YOUR_WEBSERVICE_KEY');
You may immediately set ws_key in webservice dispatcher.php
$wsKey = Configuration::get('YOUR_WEBSERVICE_KEY'); $_GET['ws_key'] = $wsKey;
Right here is the file path: YOUR_PRESTASHOP_ROOT/webservice/dispatcher.php
Now you may verify there is no such thing as a authentication set for webservice request & no ws_key go within the API URL however the end result remains to be current.
That’s all about this weblog. Hope it would make it easier to.
If you’re going through any points or have any doubts in regards to the above course of, please be happy to contact us by means of the remark part.
Additionally, you may discover our PrestaShop Growth Providers and a wide range of high quality PrestaShop Modules.
For any doubt contact us at [email protected]
On this weblog, we are going to discover ways to ship webservice key within the authorization header as an alternative of the URL.
Generally we’d like that we don’t need to present webservice key within the API URL & Prestashop sends ws_key with its worth within the URL. Examine this:
If we need to take away this from the URL, we have to ship this within the authorization header as Fundamental Auth. Please verify the beneath picture.
Additionally, there’s one other choice to handle webservice key privateness. You may set this ws_key immediately within the code to handle APIs.
For this, It’s essential save webservice key in a configuration key & then you may immediately entry this ws_key.
$wsKey = Configuration::get('YOUR_WEBSERVICE_KEY');
You may immediately set ws_key in webservice dispatcher.php
$wsKey = Configuration::get('YOUR_WEBSERVICE_KEY'); $_GET['ws_key'] = $wsKey;
Right here is the file path: YOUR_PRESTASHOP_ROOT/webservice/dispatcher.php
Now you may verify there is no such thing as a authentication set for webservice request & no ws_key go within the API URL however the end result remains to be current.
That’s all about this weblog. Hope it would make it easier to.
If you’re going through any points or have any doubts in regards to the above course of, please be happy to contact us by means of the remark part.
Additionally, you may discover our PrestaShop Growth Providers and a wide range of high quality PrestaShop Modules.
For any doubt contact us at [email protected]