You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment it seems that the catalog item attributes are not particularly easy to get to and require you to know some magic strings in order to get the ones you want. Am I missing something or is that just the way it is? Any ideas on how best to improve on the current implementation given that I am yet to find a definitive list of said magic strings?
As an example, take the following request:
var searchParameters = new ParameterGetCatalogItem
{
marketplaceIds = new[] {MarketPlace.UnitedKingdom.ID},
ASIN = asin,
includedData = new List<Constants.IncludedData>()
{
Constants.IncludedData.attributes,
Constants.IncludedData.images,
Constants.IncludedData.summaries,
Constants.IncludedData.dimensions,
Constants.IncludedData.salesRanks
}
};
return await _amazonConnection.CatalogItem.GetCatalogItem202204Async(searchParameters);
I want to get the catalog item name/title and have to do this...
if (!item.Attributes.ContainsKey("item_name")) return;
var itemName = (JArray) item.Attributes.FirstOrDefault(a => a.Key == "item_name").Value;
if (itemName != null)
{
listing.Title = itemName.Values<string>("value").FirstOrDefault();
}
It feels pretty messy and unintuitive so welcome any input on how it might be done better.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
At the moment it seems that the catalog item attributes are not particularly easy to get to and require you to know some magic strings in order to get the ones you want. Am I missing something or is that just the way it is? Any ideas on how best to improve on the current implementation given that I am yet to find a definitive list of said magic strings?
As an example, take the following request:
I want to get the catalog item name/title and have to do this...
It feels pretty messy and unintuitive so welcome any input on how it might be done better.
Beta Was this translation helpful? Give feedback.
All reactions