Search the Community
Showing results for tags 'webservice-xml'.
-
Hello, I’m trying to store Product with Feature using Prestashop Webservice API. I’m using following end-points for this process. Product insert - http://localhost/prestashop_16/api/products?schema=synopsis Feature Value- http://localhost/prestashop/api/product_feature_values?schema=synopsis I tried following two ways: Try 1 Step 1- First Add feature value with following request. URL : http://localhost/prestashop/api/product_feature_values?schema=synopsis Request Body : <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <product_feature_value> <id_feature required="true" format="isUnsignedId">1</id_feature> <custom format="isBool">1</custom> <value required="true" maxSize="255" format="isGenericName"> <language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId">My Feature from web service</language> </value> </product_feature_value> </prestashop> Result: 1. Entries are made in 'feature_value' and 'feature_value_lang' tables but not in feature_product 2. I got the returnid of id_feature_value. STEP 2- I use the return id of id_feature_value in this products API: URL : http://localhost/prestashop_16/api/products?schema=synopsis Request Body : <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <product> <price required="true" format="isPrice">1100</price> <link_rewrite required="true" maxSize="128" format="isLinkRewrite"><language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId" >www.ankit_100.com</language></link_rewrite> <name required="true" maxSize="128" format="isCatalogName"><language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId" >External Hard disk</language></name> <associations> <product_features node_type="product_features"> <product_features> <id required="true">1</id> <custom>1</custom> <id_feature_value >1</id_feature_value> </product_features> </product_features> </associations> </product> </prestashop> Result- Entries are made in feature_product and feature_value, but not in feature_value_lang Try 2 Add all the param in single request : URL : http://localhost/prestashop_16/api/products?schema=synopsis Request Body : <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <product> <price required="true" format="isPrice">1100</price> <link_rewrite required="true" maxSize="128" format="isLinkRewrite"><language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId" >www.ankit_100.com</language></link_rewrite> <name required="true" maxSize="128" format="isCatalogName"><language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId" >ankit_104</language></name> <associations> <product_features node_type="product_features"> <product_features> <id required="true">1</id> <custom>1</custom> <id_feature_value xlink:href="http://localhost/prestashop_16/api/product_feature_values/" required="true"> <product_feature_values> <product_feature_value> <id_feature required="true" format="isUnsignedId">1</id_feature> <custom format="isBool">1</custom> <value required="true" maxSize="255" format="isGenericName"> <language id="1" xlink:href="http://localhost/prestashop_16/api/languages/1" format="isUnsignedId">Hello My Feature from web service</language> </value> </product_feature_value> </product_feature_values> </id_feature_value> </product_features> </product_features> </associations> </product> </prestashop> Result : Not getting any feature value in feature_value_lang table. Can anyone pinpoint the mistake in any of above two approaches?