Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

REST API Create new Category

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 06-07-2018, 01:43 PM
 
rstubbe rstubbe is offline
 

Member
  
Join Date: Nov 2005
Posts: 14
 

Default REST API Create new Category

I am trying to add a category via the REST API, but every attempt seem to fail with an error 400 or a success, but then the consistency check fails.

What I do is the following:
POST http://localhost/xcart5/admin.php?target=RESTAPI&_key=mykey&_path=category /0
with data:
{"depth":0,"pos":0,"translations":[{"code":"nl","name":"ALBUM & LIJST"},{"code":"en","name":"ALBUM & LIJST"}]}

It will give me the Success but actually creates a second root causing the consistancy check to fail.

When I change the data to:
{"depth":0,"pos":0,"translations":[{"code":"nl","name":"ALBUM & LIJST"},{"code":"en","name":"ALBUM & LIJST"}],parent:{"ogMeta":"","useCustomOG":false,"demo":fa lse,"useClasses":"A","category_id":1,"lpos":1,"rpo s":4,"enabled":true,"show_title":false,"depth": -1,"pos":0,"root_category_look":"icons","metaDescTy pe":"A","xcPendingExport":false,"lastUsage":0}}

Basicly adding the parent it will give me an error 400 Input data is incorrect

I also tried with specifying rpos/lpos, but it keeps on failing.

Can someone give me a working example?
__________________
Ronald Stubbe
X-Cart 4.1.4
Reply With Quote
  #2  
Old 07-26-2018, 06:03 AM
 
rstubbe rstubbe is offline
 

Member
  
Join Date: Nov 2005
Posts: 14
 

Default Re: REST API Create new Category

Basicly, the add Category API call us totally useless!
__________________
Ronald Stubbe
X-Cart 4.1.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:03 AM.

   

 
X-Cart forums © 2001-2020