Jump to content

Edit History

wissam_dk

wissam_dk

Hi 

I am using ARC/Postman to configure 2 endpoints for both Prestashop 1.6 & 1.7:

1) getConfig (Working):

    - GET url is: 

    

http://localhost/prestashop1.6/module/wissam/getconfig?private_key=PRIVATE_KEY&key=PUBLIC_KEY

 

    and it returns a json object which i have decode into array object in my php code.

2) setConfig:

    - POST url is:

    

http://localhost/prestashop1.6/module/wissam/setconfig?private_key=PRIVATE_KEY&key=PUBLIC_KEY

 

    and BODY is Raw input where it contain json object with edited values.

    But I cannot find  a way in my php code to read the BODY json data into a  variable.

    

   

Is there a call function in Prestashop to get value of RAW body data like for example:

Tools::getValue($key);

Like we do in Wordpress:

$request = new WP_REST_Request( 'POST', '/setconfig' );

$body = $request->get_body();

 

prestashop-wissam-set-api.png

prestashop-wissam-get-api.png

wissam_dk

wissam_dk

Hi 

I am using ARC/Postman to configure 2 endpoints for both Prestashop 1.6 & 1.7:

1) getConfig (Working):

    - GET url is: 

    http://localhost/prestashop1.6/module/wissam/getconfig?private_key=PRIVATE_KEY&key=PUBLIC_KEY

    and it returns a json object which i have decode into array object in my php code.

2) setConfig:

    - POST url is:

    http://localhost/prestashop1.6/module/wissam/setconfig?private_key=PRIVATE_KEY&key=PUBLIC_KEY

    and BODY is Raw input where it contain json object with edited values.

    But I cannot find  a way in my php code to read the BODY json data into a  variable.

    

    HOW CAN I DO THAT ? Help please   

 

prestashop-wissam-set-api.png

prestashop-wissam-get-api.png

×
×
  • Create New...