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 09-12-2016, 06:01 AM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Thumbs up Rest Api

Hi ,

In My X-cart 5 store, i install REST API in it.

Using REST API Modules i insert data to admin, but i don't know how get Data From the Admin to Customer End just i want know where i want to do work and how to get detail to customer End

I need below things ,

1) API: Featured products
2) API: Latest arrivals
3) API: Related products
4) API: Static pages API: Search

Kindly suggest me ...

Awaiting For your Reply

Thanks,
vignesh
__________________
kutty
Reply With Quote
  #2  
Old 09-13-2016, 04:04 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Rest Api

Did you check the documentation at http://devs.x-cart.com/en/basics/rest_api_documentation.html ?

Rest API is a method to manipulate objects that are subclass of \XLite\Model\AEntity. So, you should check what models the listed features add and access their methods via the API.
__________________
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 09-13-2016, 08:58 PM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Default Re: Rest Api

Thank you. Orders, products and categories are fine. I want to know how to write a new API service that will give us the static pages list and details?

How to create and get the featured products list?

How to create and get the bestsellers products list?
__________________
kutty
Reply With Quote
  #4  
Old 09-18-2016, 10:44 PM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Thumbs up Re: Rest Api

Hi

I have \XLite\Model\AEntity for product,Category,Featureproduct, static pages and Some others.

For That I Would Call it's easy to GET that detail using REST API

For Example if i want Feature Product then put below url

http://localhost/xcart5203/admin.php?target=RESTAPI&_key=test_full&_path=cdev -featuredproducts-featuredproduct

But Now i Need Bestsellers,Coming Soon,Recently Viewed and New Arrival Those things Does not

have \XLite\Model\AEntity .So Kindly Suggest me How To Get Data For

1)Bestsellers 2)Coming Soon 3)Recently View 4)New Arrival

Awaiting For your Reply

Thanks
Kutty

Xcart 5.2.15
__________________
kutty
Reply With Quote
  #5  
Old 09-22-2016, 10:47 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Rest Api

Bestsellers, new arrivals and other listed entities are \XLite\Model\Product.
So, you should retrive product models and use the _cnd parameter to filter the returned data.
I'm not sure if the modules provide all necessary search handlers in their Repo classes (the _cnd parameter is translated to prepareCnd*()" methods of Repo classes). You may have to add such methods manually by creating a custom module.
__________________
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
  #6  
Old 09-23-2016, 01:07 AM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Thumbs up Re: Rest Api

Hi,

First Of all thanks for your Reply, Yeah finally i got how fetch data using REST API in my x-cart 5.2.15 Store.

Now I know how to fetch all data that list above reply also i find it..using developer guide manual.

but now i have problem with slow fetch data using REST API.

i given my request URL in my browser

http://localhost/xcart5203/admin.php?target=RESTAPI&_key=test_full&_path=cdev -featuredproducts-featuredproduct - takes 6 seconds to load data

In my module link

http://localhost/xcart5203/admin.php?target=RESTAPI&_key=test_full&_path=myde velopmentid-mymodulename-mymoduleclassname - takes 12 seconds to load data

please guide me what are possible feature this loaded times takes

first of all i tried in localhost loaded time is 10 seconds,In server it takes more than 19 seconds.

Guide me what are possible feature this loaded times occur... how to reduce loaded time??


thanks
kutty
5.2.15
__________________
kutty
Reply With Quote
  #7  
Old 09-29-2016, 07:44 AM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Thumbs up Re: Rest API

Hi Team,

I have created a separate page called showproducts.php (Client application that is hosted in separate website domain, not the main website where X-Cart 5.2.15 is hosted). I have accessed the main site products data using REST API. I am facing two problems at the moment.



1) In the single call "all products, categories, manufacturers, pages" are called. We have created one custom module and when the module is enabled, all these data are pulled in a single web service call. It is very heave data. Obviously this substantially increases the page loading. will it be possible to access products data separately, categories data separately by calling different web service call when the module is enabled. I am able to create different web services by creating different modules for each service. I do want "One module, multiple web services"


2) The main site has more than 30,000 products. I can use limit option to pull first 1000 records. We don't want to call web services to load 20/100 products every time. In this case, "Time To First Byte (TTFB) is very long" when we work in local enviornment or another server. How can this be increased.


Thanks,
Vigneshkutty,
X-Cart.5.2.15.
__________________
kutty
Reply With Quote
  #8  
Old 10-03-2016, 08:40 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Rest Api

1) I'm sorry, but I don't understand what you mean there. What is the problem of creating a single module that handles multiple custom API calls?

2) What do you want to increase? Are you sure that retrieving 30K database records is a good idea? What do you want to achieve in the end?
__________________
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
  #9  
Old 10-04-2016, 01:29 AM
 
vigneshkutty vigneshkutty is offline
 

Member
  
Join Date: Jul 2016
Posts: 24
 

Thumbs up Re: Rest Api

Hi qualiteam ,

The Problem ,We Are facing whenever we call our custom module using REST API
it's takes more time to show output even through it has less data, we want know how to reduce this time.

When inspect the page, Loaded for TTFB(Time To First Byte ) time is too long even through it in our localhost.

How reduce this time?? to Show output more quick..

Thanks,
VigneshKutty,
X cart 5.2.15
__________________
kutty
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 01:35 AM.

   

 
X-Cart forums © 2001-2020