Jump to content

[Webservice] create category -> 400 error


marc_mirsounet

Recommended Posts

Hi everyone!

 

I'm trying to create a category but this code but I get an 400 error...

$webService = new PrestaShopWebservice($url, PS_WS_AUTH_KEY, DEBUG);
$xml = $webService->get(array('url' => $url.'/api/categories?schema=blank'));
$category = $xml->children()->children();
$category->name->language[0][0] = "test";
$category->link_rewrite->language[0][0] = "test";
$category->active = 1;    
    
$opt = array('resource' => 'categories');
$opt['postXml'] = $xml->asXML();
$xml = $webService->add($opt); 

I tried to change "blank" by "synopsis" but nothing working. Someone already had this issue?

 

 

Thx everyone!

 

Link to comment
Share on other sites

  • 5 months later...

Hi, I have the same problem....

Adding products, images, etc... works fine. But there is "something" with add category - looks simply, but do not work.

I tried with "unset" some unneeded fields, but no effects.

 

I'he testing with PS 1.6.10. 

 

Did someone know the solution ?

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