| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
REST API Create new Category | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#2
|
|||||||
|
|||||||
Re: REST API Create new Category
Basicly, the add Category API call us totally useless!
__________________
Ronald Stubbe X-Cart 4.1.4 |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|