Post Reply 5 posts Page 1 of 1
Retrieving a photo via the API
  • greendog
    New User
    New User
    Posts: 3
    Joined: Fri Aug 20, 2010 3:24 pm
    Location: Duluth, Georgia US
    Contact:

    Retrieving a photo via the API

    by greendog » Fri Aug 20, 2010 3:28 pm

    When I pull a product from the RE db via the API, the XML returned does not contain any information about product photos. For example, I can look in RE and pull up this product, which has a photo attached. But notice the XML below has no such info:

    Code: Select all

    <?xml version="1.0"?>
    <RetailEdge_Response>
    	<Time_Secs>0.233</Time_Secs>
    	<Time_MilSecs>233</Time_MilSecs>
    	<CharCount>2053</CharCount>
    	<ResponseList>
    		<Response ID="-1">
    			<Error_Code>0</Error_Code>
    
    			<Function>Inv_Get</Function>
    			<RecordCount>1</RecordCount>
    			<Time_Secs>0.171</Time_Secs>
    			<Time_MilSecs>171</Time_MilSecs>
    			<Table>
    				<Record>
    					<Inv_Name>1085</Inv_Name>
    
    					<Inv_Desc>python flat over-the-knee-boot</Inv_Desc>
    					<Inv_ItemID>651113</Inv_ItemID>
    					<Inv_Desc_1>python flat over-the-knee-boot</Inv_Desc_1>
    					<Inv_Notes1></Inv_Notes1>
    					<Inv_Notes2></Inv_Notes2>
    					<Inv_DepartID>89166599250001</Inv_DepartID>
    					<Inv_VendorID>82940950230001</Inv_VendorID>
    
    					<Inv_ClassID>58232371060001</Inv_ClassID>
    					<Inv_Cost_Last>640</Inv_Cost_Last>
    					<Inv_Cost_Avg>640</Inv_Cost_Avg>
    					<Inv_Part_Mfr></Inv_Part_Mfr>
    					<Inv_Part_Vendor></Inv_Part_Vendor>
    					<Inv_ExpCode></Inv_ExpCode>
    					<Inv_UPC1></Inv_UPC1>
    
    					<Inv_UPC2></Inv_UPC2>
    					<Inv_User1></Inv_User1>
    					<Inv_User2></Inv_User2>
    					<Inv_User3></Inv_User3>
    					<Inv_User4></Inv_User4>
    					<Inv_User5></Inv_User5>
    					<Inv_Date_Last>2010-05-31 03:57:27.625 pm</Inv_Date_Last>
    					<Inv_Sequence>1</Inv_Sequence>
    
    					<Inv_Loc_Price_Was>640</Inv_Loc_Price_Was>
    					<Inv_Loc_Price1>640</Inv_Loc_Price1>
    					<Inv_Loc_Price2>640</Inv_Loc_Price2>
    					<Inv_Loc_Price3>640</Inv_Loc_Price3>
    					<Inv_Loc_Price4>640</Inv_Loc_Price4>
    					<Inv_Loc_Price5>640</Inv_Loc_Price5>
    
    					<Inv_Loc_Taxable>True</Inv_Loc_Taxable>
    					<Inv_Loc_BinShelf></Inv_Loc_BinShelf>
    					<Inv_Loc_Min1>0</Inv_Loc_Min1>
    					<Inv_Loc_Min2>0</Inv_Loc_Min2>
    					<Inv_Loc_Min3>0</Inv_Loc_Min3>
    					<Inv_Loc_Min4>0</Inv_Loc_Min4>
    
    					<Inv_Loc_Max1>0</Inv_Loc_Max1>
    					<Inv_Loc_Max2>0</Inv_Loc_Max2>
    					<Inv_Loc_Max3>0</Inv_Loc_Max3>
    					<Inv_Loc_Max4>0</Inv_Loc_Max4>
    					<Inv_ListID>94982091090001</Inv_ListID>
    					<Inv_Created>2010-05-31 03:57:27.625 pm</Inv_Created>
    
    					<Inv_Modified>2010-05-31 03:57:27.625 pm</Inv_Modified>
    					<Inv_Sequence_1>1</Inv_Sequence_1>
    					<Inv_Stat_Del>0</Inv_Stat_Del>
    				</Record>
    			</Table>
    		</Response>
    	</ResponseList>
    
    </RetailEdge_Response>bool(true)
    
    So my question is, how do I reference the photo and retrieve it via the API?

    Thanks,
    Bob
  • User avatar
    Andy
    Developer
    Developer
    Posts: 146
    Joined: Mon Jan 23, 2006 1:30 pm

    Re: Retrieving a photo via the API

    by Andy » Wed Aug 25, 2010 8:28 am

    Bob,

    You are correct that there is currently no way to retrieve item images via the API. To date, no one has requested this feature (surprising, isn't it?).

    Is this something you are interested in? If so, how would you like to use a function like Item_GetImage?

    Thanks.
  • User avatar
    RetailEdge Moderator
    Site Admin
    Site Admin
    Posts: 1290
    Joined: Mon Jan 23, 2006 4:02 pm
    Location: Rutland, VT
    Contact:

    Re: Retrieving a photo via the API

    by RetailEdge Moderator » Wed Aug 25, 2010 9:02 am

    Bob,

    First when purchasing the API server you get 90 days of free technical support. So if you want a quicker response, you might want to just try calling. Just an FYI

    Your question is a good one. In RetailEdge we do allow images with inventory items. However typically these are lower res images (although they don't have to be) that will be displayed on the sales screen when the item is sold. This is really used to help the clerks when they are selling items so that for instance if they scan a pair of pants and a shirt comes up they know the item being sold is incorrect. Also if a customer wants to take a quick look at another color that might be out of stock, you can show them a simple picture of the item.

    This is different than what a website might want to have multiple Hi Res images (1000 x 1000) to show different views, etc. and in many different formats (gif, jpg, png, bmp etc.) RetailEdge currently only supports BMPs and JPEGs. Also RetailEdge supports having up to one million active items in its inventory. If you were to put that much data in the program it would potentially do a couple of things:

    1. Slow down the sales process.
    2. Make multi-store synchronization slower.
    3. Require a large amount of space for the RetailEdge data. For instance a 1000 x 1000 JPG would be around 1MB. Multiply this by the amount of potential inventory items and you have a very large database to deal with.

    What other integrations have done is:

    1. For new items going to the e-commerce site, upload the information from RetailEdge without the images to a Staging Area. This staging area is used to post images for the items and also make changes to descriptions etc. The data coming up from RetailEdge will not be formatted and many times users want to format or add information about the items before it is posted to their live site.

    2. For existing items, use the information from RetailEdge just for quantity, pricing (and maybe description) updates to the e-commerce inventory database. The API also has the ability to just get real time quantities so some integrations are updating pricing information nightly and then when they build their pages they get the quantity real time. Another approach is to do a nightly upload of inventory quantity and pricing updates. Then when a web sale is posted into RetailEdge, check the quantity of the items in the sale and just update these quantities after the sale is posted. This provides a little more real time inventory quantity information than a simple night time upload.

    Anyway, as Andy has implied we can make modifications to the API to suit your needs. Let us know what you are trying to do and why you might need images and we will see if we can do it with some separate function.


    greendog wrote:When I pull a product from the RE db via the API, the XML returned does not contain any information about product photos. For example, I can look in RE and pull up this product, which has a photo attached. But notice the XML below has no such info:

    Code: Select all

    <?xml version="1.0"?>
    <RetailEdge_Response>
    	<Time_Secs>0.233</Time_Secs>
    	<Time_MilSecs>233</Time_MilSecs>
    	<CharCount>2053</CharCount>
    	<ResponseList>
    		<Response ID="-1">
    			<Error_Code>0</Error_Code>
    
    			<Function>Inv_Get</Function>
    			<RecordCount>1</RecordCount>
    			<Time_Secs>0.171</Time_Secs>
    			<Time_MilSecs>171</Time_MilSecs>
    			<Table>
    				<Record>
    					<Inv_Name>1085</Inv_Name>
    
    					<Inv_Desc>python flat over-the-knee-boot</Inv_Desc>
    					<Inv_ItemID>651113</Inv_ItemID>
    					<Inv_Desc_1>python flat over-the-knee-boot</Inv_Desc_1>
    					<Inv_Notes1></Inv_Notes1>
    					<Inv_Notes2></Inv_Notes2>
    					<Inv_DepartID>89166599250001</Inv_DepartID>
    					<Inv_VendorID>82940950230001</Inv_VendorID>
    
    					<Inv_ClassID>58232371060001</Inv_ClassID>
    					<Inv_Cost_Last>640</Inv_Cost_Last>
    					<Inv_Cost_Avg>640</Inv_Cost_Avg>
    					<Inv_Part_Mfr></Inv_Part_Mfr>
    					<Inv_Part_Vendor></Inv_Part_Vendor>
    					<Inv_ExpCode></Inv_ExpCode>
    					<Inv_UPC1></Inv_UPC1>
    
    					<Inv_UPC2></Inv_UPC2>
    					<Inv_User1></Inv_User1>
    					<Inv_User2></Inv_User2>
    					<Inv_User3></Inv_User3>
    					<Inv_User4></Inv_User4>
    					<Inv_User5></Inv_User5>
    					<Inv_Date_Last>2010-05-31 03:57:27.625 pm</Inv_Date_Last>
    					<Inv_Sequence>1</Inv_Sequence>
    
    					<Inv_Loc_Price_Was>640</Inv_Loc_Price_Was>
    					<Inv_Loc_Price1>640</Inv_Loc_Price1>
    					<Inv_Loc_Price2>640</Inv_Loc_Price2>
    					<Inv_Loc_Price3>640</Inv_Loc_Price3>
    					<Inv_Loc_Price4>640</Inv_Loc_Price4>
    					<Inv_Loc_Price5>640</Inv_Loc_Price5>
    
    					<Inv_Loc_Taxable>True</Inv_Loc_Taxable>
    					<Inv_Loc_BinShelf></Inv_Loc_BinShelf>
    					<Inv_Loc_Min1>0</Inv_Loc_Min1>
    					<Inv_Loc_Min2>0</Inv_Loc_Min2>
    					<Inv_Loc_Min3>0</Inv_Loc_Min3>
    					<Inv_Loc_Min4>0</Inv_Loc_Min4>
    
    					<Inv_Loc_Max1>0</Inv_Loc_Max1>
    					<Inv_Loc_Max2>0</Inv_Loc_Max2>
    					<Inv_Loc_Max3>0</Inv_Loc_Max3>
    					<Inv_Loc_Max4>0</Inv_Loc_Max4>
    					<Inv_ListID>94982091090001</Inv_ListID>
    					<Inv_Created>2010-05-31 03:57:27.625 pm</Inv_Created>
    
    					<Inv_Modified>2010-05-31 03:57:27.625 pm</Inv_Modified>
    					<Inv_Sequence_1>1</Inv_Sequence_1>
    					<Inv_Stat_Del>0</Inv_Stat_Del>
    				</Record>
    			</Table>
    		</Response>
    	</ResponseList>
    
    </RetailEdge_Response>bool(true)
    
    So my question is, how do I reference the photo and retrieve it via the API?

    Thanks,
    Bob
  • greendog
    New User
    New User
    Posts: 3
    Joined: Fri Aug 20, 2010 3:24 pm
    Location: Duluth, Georgia US
    Contact:

    Re: Retrieving a photo via the API

    by greendog » Wed Aug 25, 2010 9:16 am

    Thanks, Andy. Something like Item_GetImage would be good to have. Would also be nice to have a field or two for each image in the response from an Inv_Get call (or the like):

    Code: Select all

    <Record>
    	<Inv_Name>TEST</Inv_Name>
    	<Inv_Desc>Test Item</Inv_Desc>
    	<Inv_ItemID>239306</Inv_ItemID>
    	...
    	...
    	<Inv_ImageName>{imagename.jpg}</Inv_ImageName>
    	<Inv_ImagePath>{Drive:\\Directory\Path\To\imagename.jpg}</Inv_ImagePath>
    </Record>
    If multiple images are allowed, the above could look something like:

    Code: Select all

    <Record>
    	<Inv_Name>TEST</Inv_Name>
    	<Inv_Desc>Test Item</Inv_Desc>
    	<Inv_ItemID>239306</Inv_ItemID>
    	...
    	...
    	<Inv_Image>
    		<Inv_ImageName>{imagename1.jpg}</Inv_ImageName>
    		<Inv_ImagePath>{Drive:\\Directory\Path\To\imagename1.jpg}</Inv_ImagePath>
    	</Inv_Image>
    	<Inv_Image>
    		<Inv_ImageName>{imagename2.jpg}</Inv_ImageName>
    		<Inv_ImagePath>{Drive:\\Directory\Path\To\imagename2.jpg}</Inv_ImagePath>
    	</Inv_Image>
    </Record>
    If I had my druthers, Item_GetImage would take the Inv_ItemID as a search term and return all photos (assuming multiple photos are allowed by RE) for that item:

    Code: Select all

    <FunctionList>
    	<Function>
    		<Name>Cust_Get</Name>
    		<Params>
    			<Where>Inv_ItemID = 12345</Where>
    		</Params>
    	</Function>
    </FunctionList>
    and RE would return a variety of info about each photo:

    Code: Select all

    <?xml version="1.0"?>
    <RetailEdge_Response>
    	<Time_Secs>n.nn</Time_Secs>
    	<Time_MilSecs>nnn</Time_MilSecs>
    	<CharCount>nnn</CharCount>
    	<ResponseList>
    		<Response ID="-1">
    			<Error_Code>0</Error_Code>
    			<Function>Inv_GetImage</Function>
    			<RecordCount>2</RecordCount>
    			<Time_Secs>n.nnn</Time_Secs>
    			<Time_MilSecs>nnn</Time_MilSecs>
    			<Table>
    				<Record>
    					<Inv_ImageName>imagename1.jpg</Inv_ImageName>
    					<Inv_ImagePath>Directory:\\Path\To\imagename1.jpg</Inv_ImagePath>
    					<Inv_ImageSize>22345</Inv_ImageSize>
    					<Inv_ImageWidth>600</Inv_ImageWidth>
    					<Inv_ImageHeight>400</Inv_ImageHeight>
    					<Inv_ImageMime>image/jpeg</Inv_ImageMime>
    				</Record>
    				<Record>
    					<Inv_ImageName>imagename2.jpg</Inv_ImageName>
    					<Inv_ImagePath>Directory:\\Path\To\imagename2.jpg</Inv_ImagePath>
    					<Inv_ImageSize>23324</Inv_ImageSize>
    					<Inv_ImageWidth>600</Inv_ImageWidth>
    					<Inv_ImageHeight>400</Inv_ImageHeight>
    					<Inv_ImageMime>image/jpeg</Inv_ImageMime>
    				</Record>
    			</Table>
    		</Response>
    	</ResponseList>
    </RetailEdge_Response>
    Is something like this a possibility? And (more important to our client) would there be a charge involved? :)

    Cheers,
    Bob
  • greendog
    New User
    New User
    Posts: 3
    Joined: Fri Aug 20, 2010 3:24 pm
    Location: Duluth, Georgia US
    Contact:

    Re: Retrieving a photo via the API

    by greendog » Wed Aug 25, 2010 9:26 am

    Bill wrote:So if you want a quicker response, you might want to just try calling. Just an FYI
    Good point. :-) I actually wanted to post it here for the ability to include code, but after reading your response, that probably was unnecessary anyway.
    Bill wrote: 1. For new items going to the e-commerce site, upload the information from RetailEdge without the images to a Staging Area. This staging area is used to post images for the items and also make changes to descriptions etc. The data coming up from RetailEdge will not be formatted and many times users want to format or add information about the items before it is posted to their live site.

    2. For existing items, use the information from RetailEdge just for quantity, pricing (and maybe description) updates to the e-commerce inventory database. The API also has the ability to just get real time quantities so some integrations are updating pricing information nightly and then when they build their pages they get the quantity real time. Another approach is to do a nightly upload of inventory quantity and pricing updates. Then when a web sale is posted into RetailEdge, check the quantity of the items in the sale and just update these quantities after the sale is posted. This provides a little more real time inventory quantity information than a simple night time upload.
    I see your point. Mainly my thinking was to make it as trouble-free for the client as possible by giving them as few places to have to interact with the data as possible. I think a combination of #1 and #2 above will be the path we take, though. Really and truly we only need to update the quantities and pricing and maybe a few other items. As they add new merchandise they can follow a path similar to what you've described in #1.
    Bill wrote: Anyway, as Andy has implied we can make modifications to the API to suit your needs. Let us know what you are trying to do and why you might need images and we will see if we can do it with some separate function.
    Already replied to Andy with API ideas. However, thinking it may not be necessary now if I stick to the points above. Well, at the very least, you have some ideas for your API in case someone else wants to do something with the images, right? :-)

    Cheers,
    Bob
Post Reply 5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 38 guests