eBay SDK for .NET
Attributes & Catalogs > Retrieving Attribute and Product Meta-Data > Retrieving Item Specifics Meta-Data 
 



< Back Next >

Retrieving Item Specifics Meta-Data

This section discusses the means and strategies for retrieving Item Specifics that have been defined for the categories on a particular eBay site. Specifically, it focuses on retrieving Item Specifics in the format that would be used when a seller is listing an item the standard way.

Many categories support listing the standard way with Item Specifics. As each eBay site has its own category hierarchy, the exact combination of Item Specifics that are available and the kinds of categories that support this feature can vary for different sites. Furthermore, the Item Specifics meta-data for any given category can be updated without notice.

When you are listing an item the standard way, you determine the Item Specifics for a given category by using GetAttributesCSCall. This call gives you a dynamic and scalable way to import, update, and render Item Specifics meta-data for any category in an application. You should not hard-code Item Specifics meta-data in your application.

The Attributes Library includes a sample data-source provider class called AttributesXmlDownloader, which executes GetAttributesCSCall and handles other common functionality that you need when working with Item Specifics. This class implements the IAttributesXmlProvider interface and caches the data in memory. If you want to use the Attributes Library, you can use the sample downloader class or you can create your own implementation of the IAttributesXmlProvider interface that stores the data in a different way (such as in a database).

GetAttributesCSCall returns the Item Specifics XML for one or more categories in a single AttributeData object as a string. The attributes and values are not defined in the WSDL (i.e., there are no code lists that describe the meta-data). Describing Item Specifics as a raw XML string makes it possible to use eBay's Item Specifics SYI XSL stylesheet to render the data in a graphical user interface.

Only use GetAttributesCSCall to retrieve Item Specifics when you are listing an item the standard way. That is, do not use it when you are creating a listing with Pre-filled Item Information.

This section describes the following process:

Prerequisites

Step 1:  Indicate the Characteristic Set Data to Return

Step 2:  Make the API Call

Step 3:  Store the Item Specifics Data for Future Use

Step 4:  Maintain the Item Specifics XML

Step 5:  Note: Next Steps

Prerequisites

Make sure your locally cached category-to-characteristics data is up to date (see Retrieving Category-to-Meta-Data Mappings).

Although you do not necessarily have to specify a characteristic set in order to execute GetAttributesCSCall or a data-source provider class that implements IAttributesXmlProvider, you will need to know the correct mappings for each category in order to determine which set of Item Specifics to use later during the listing process.

Step 1: Indicate the Characteristic Set Data to Return

As the attribute meta-data contains a large volume of data, you should retrieve and store all the data once and then retrieve only the information that changes. This is similar to the process you use to retrieve and store the category-to-characteristic set mappings. If you are using the Attributes Library, the same principle applies when working with classes that implement IAttributesXmlProvider, such as the AttributesXmlDownloader class.

The first time you execute GetAttributesCSCall or the AttributesXmlDownloader class, you should retrieve all the available meta-data for the site's current category hierarchy.

Optionally, if you want to be able to use a category ID to auto-fill certain attributes, set the IncludeCategoryMappingDetails flag to true. This causes the response to include a list of categories along with attributes and values that your application can auto-fill for items listed in those categories. This feature is primarily useful for sellers who want to use a listing's category ID to auto-fill attributes on the client side (instead of allowing eBay to do this on the server when the item is listed).

After initially obtaining the meta-data, in subsequent calls use the locally saved version of the data in the AttributeSystemVersion filter (which you can access by means of the AttributeVersion property of the call) to check whether the version has changed. If it has, use the version information to get changes that have been made to the mappings.

Optionally, use the AttributeSetID property as a filter to limit the results to a specific characteristic set. Use the the AttributeSetIDList property of the call to specify the attribute set IDs. If not specified, then the meta-data for all attribute-enabled categories is returned. To determine the available characteristic set IDs, execute GetCategory2CSCall or use your data-source provider class to look up the IDs in the mapping data that you have stored locally.

See GetAttributesCS for information on the best ways to use data filters like AttributeSystemVersion, AttributeSetID, and DetailLevel.

You can expect the meta-data to be updated at least once or twice a month, but it may sometimes be updated more frequently than this interval. Use GetAttributesCSCall or your data-source provider class to check the version at least once a day, and then retrieve any changes to the meta-data if the version has changed.

The call-specific properties are also described in GetAttributes Input Fields.

When you use the Attributes Library to retrieve Item Specifics, you create an instance of the AttributesMaster class and configure it to use a data-source provider, such as the AttributesXmlDownloader class.

Step 2: Make the API Call

Making the API call with the Attributes Library entails invoking the AttributesXmlDownloader.DownloadXml( ) method, which parses the returned XML string and creates an XmlDocument object that is easier to work with. If you create your own data-source provider class that implements the IAttributesXmlProvider interface, your class would call the GetAttributesCS( ) method defined on the GetAttributesCSCall class to retrieve the XML string. Note: See the AttributesDemo sample for an example of how to do this.

GetAttributesCSCall returns a string that specifies the Item Specifics XML for the characteristic sets that you requested. Your data-source provider class should parse this string to create an XmlDocument object. See the AttributesXmlDownloader class for an example of how to do this.

See GetAttributesCS and The Attribute Meta-Data Model for information about the data that is returned.

See the generated library reference documentation for GetAttributesCSCall and AttributesXmlDownloader for additional fields and methods that you can use to access and manipulate the retrieved data.

An application uses the characteristics meta-data in the AttributeData property of the response object to determine the Item Specifics or return policy options that are available in the corresponding categories.

Depending on your application's workflow, you can use the meta-data along with the Item Specifics SYI XSL stylesheet to render Item Specifics or return policy options in your application's user interface, from which the user can select the attributes to include in their listing.

Optionally, if you set IncludeCategoryMappingDetails flag to true in the request, use the category mappings returned in the response (if any) to auto-fill Item Specifics based on the category. See Auto-filling Attribute Values Based on a Listing's Category for information on how to use the Item Specifics SYI XSL stylesheet to present this data to the seller.

GetAttributesCSCall also returns the version of the complete list of mappings. The next time you execute this call, use the version information as a filter to retrieve only the data that has changed.

Step 3: Store the Item Specifics Data for Future Use

Once you have retrieved the Item Specifics meta-data, you can use the same meta-data for all listings for the rest of the day. You should not need to retrieve the meta-data again for at least 24 hours.

If you retrieved all the characteristic set data (with no AttributeSetID filter), store the version information so that you can use it as input the next time you execute the call.

Store the attribute meta-data string returned in the AttributeData object (e.g., to a database table). If you plan to use the Item Specifics XSL to render the data, see Storing the XML for Use with the Stylesheet for additional steps that you should take when storing the XML.

Archiving Previous Versions of the Item Specifics Meta-Data

Some applications overwrite their locally stored meta-data each time they retrieve the latest version of the data. Other applications save the meta-data that was in effect whenever a user created a listing with Item Specifics. The approach you use depends on the features your application provides.

The Item Specifics meta-data for any given category can change periodically as the needs of the eBay community change. Here are some situations to consider as you develop your application:

Step 4: Maintain the Item Specifics XML

At the beginning of each day that the user will create or submit listings with Item Specifics, retrieve any updates that have been made to the meta-data.

Step 5: Note: Next Steps

Once you have retrieved the Item Specifics meta-data, you may also need to update your locally stored Item Specifics XSL stylesheet. See Retrieving the Item Specifics SYI XSL Stylesheet.

Use the Item Specifics XML when a seller wants to list the standard way with Item Specifics. See Listing with Item Specifics and Catalog Data.


< Back Next >


 
Attributes & Catalogs > Retrieving Attribute and Product Meta-Data > Retrieving Item Specifics Meta-Data 
© 2005–2007 eBay Inc. All rights reserved.