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

Rest API

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-07-2016, 11:33 AM
 
jgm72183 jgm72183 is offline
 

Newbie
  
Join Date: Feb 2016
Posts: 2
 

Default Rest API

http://kb.x-cart.com/display/XDD/REST+API+documentation#RESTAPIdocumentation

Please do not reply with this link. It is worthless.
I am looking for some examples for other tables to use. Right now I am trying to add the image record to the items we can add.

I think anybody that has tried to use this API would really like to see some more examples than the 101 stuff on the documentation page. I am sure somebody has a full list of what this API can do....

George
Reply With Quote
  #2  
Old 02-07-2016, 10:57 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Rest API

You can use "data:image" protocol to embed the image to the API request.

Something like this:
Code:
function base64_encode_image ($filename=string, $filetype=string) { if ($filename) { $imgbinary = fread(fopen($filename, "r"), filesize($filename)); return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary); } } ... 'image' => array( 'path' => 'im123.png', 'content' => base64_encode_image(filePath, 'png') ) ...

Quote:
I am sure somebody has a full list of what this API can do....

Unfortunately, it is impossible to create the full list of API commands and parameters as it depends on the installed modules.

Basically, REST API is a bridge between third-party applications and Doctrine repository classes added by X-Cart 5 and ready-made/custom modules. It allows you to run the insert and query methods of repository classes.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 02-17-2016, 09:15 AM
 
jgm72183 jgm72183 is offline
 

Newbie
  
Join Date: Feb 2016
Posts: 2
 

Default Re: Rest API

We are using raw URLs to add items to the cart.

Example
http://personal.x-cart.com/<site>/admin.php?target=RESTAPI&_key=<restkey>&_path=prod uct Will list items.

We need the path and maybe some field names for xc_product_images.
I have tried a few that would make sense but like most things with xcart they could not just make it the table name.


Thanks,
Jamie
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 12:08 AM.

   

 
X-Cart forums © 2001-2020