Jump to content

[1.7.6.8] API/Webservice - add category


Kazz3m

Recommended Posts

Hi, have problems with add category via api 

curl -v https://[email protected]/api/categories -X POST --data '<?xml version="1.0" ?><prestashop><category><date_add></date_add><link_rewrite><language id="1">udzielenie-upustu</language><language id="2">udzielenie-upustu</language><language id="3">udzielenie-upustu</language></link_rewrite><meta_title><language id="1">Udzielenie upustu</language><language id="2">Udzielenie upustu</language><language id="3">Udzielenie upustu</language></meta_title><meta_keywords><language id="1">None</language><language id="2">None</language><language id="3">None</language></meta_keywords><name><language id="1">Udzielenie upustu</language><language id="2">Udzielenie upustu</language><language id="3">Udzielenie upustu</language></name><id_parent>2</id_parent><is_root_category>0</is_root_category><associations><products><product><id></id></product></products><categories><category><id></id></category></categories></associations><id_shop_default></id_shop_default><active>1</active><position></position><meta_description><language id="1">None</language><language id="2">None</language><language id="3">None</language></meta_description><id></id><description><language id="1">None</language><language id="2">None</language><language id="3">None</language></description></category></prestashop>'

Always end with db problem: 

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code><![CDATA[97]]></code>
<message><![CDATA[[SQL Error] Duplicate entry '583-1' for key 'PRIMARY'. From DbCore->insert() Query was : INSERT INTO `ps_category_group` (`id_category`, `id_group`) VALUES ('583', '1')]]></message>
</error>
<error>
<code><![CDATA[97]]></code>
<message><![CDATA[[SQL Error] Duplicate entry '583-1' for key 'PRIMARY'. From CategoryCore->addGroups() Query was : INSERT INTO `ps_category_group` (`id_category`, `id_group`) VALUES ('583', '1')]]></message>
</error>
</errors>
</prestashop>

Any hints?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...