Page 1 of 1
How do I display products from a web API?
Posted: Sun May 09, 2010 10:13 pm
by rewardchain
I am trying to integrate products from a web API service that provides all data and images online. It is free to use, and I would like to integrate it into ablecommcerce rather than a flat file import. They say I should be able to customize my product pages using the System.Net.WebRequest and System.Net.WebResponse. Can anyone point me to the pages I would need to edit if this is possible?
Re: How do I display products from a web API?
Posted: Mon May 10, 2010 5:05 am
by s_ismail
yes it is possible but I don't think so you need any customization in your product pages it can be achieve by writing a script that first load all items in a list then then further navigate to each item of your list and set values with ablecommerce product instance
like
Let suppose you have a product list 'lstProducts' of products then it would be like
Code: Select all
for(int i=0;i<lstProducts.count;i++)
{
Product product = new Product();
product.Name =lstProducts[i].ProductName;
product.Sku=lstProducts[i].ProductSku;
......
......
product.Save();
}
'lstProducts' will be collection of those products from where you want to import products .
Re: How do I display products from a web API?
Posted: Mon May 10, 2010 6:54 am
by mazhar
rewardchain wrote:I am trying to integrate products from a web API service that provides all data and images online. It is free to use, and I would like to integrate it into ablecommcerce rather than a flat file import. They say I should be able to customize my product pages using the System.Net.WebRequest and System.Net.WebResponse. Can anyone point me to the pages I would need to edit if this is possible?
Can you please provide some description of web API service like name, website etc. It would be handy for people to give you some idea after having a looking at it for example they may have some integration manual etc. For product page, you can browse to any product with logged in as admin it will bring you to product page. If you are trying to develop some new functionality you can create a custom conlib control and then edit the product page from bottom and use new conlib control in there where System.Net.WebRequest and System.Net.WebResponse code will be in this new conlib control.
Re: How do I display products from a web API?
Posted: Mon May 10, 2010 1:25 pm
by rewardchain
So here is a sample URL:
http://webapisite.com?method=Search.Get ... yourAPIKey
It is basically requesting tracks for the artist 'Sting' from the API, and then returns an XML or JSON response. I can then parse that XML and display the fields I want to display. The integration comes into play because I want to use able as the commerce and payment piece, rather than use theirs. Also I want to display the new releases on a category page, like you would see in iTunes, and also have users query songs to buy. These would all be XML responses and not hosted in the product catalog.