尝试使用ebay api调用在ebay电机中发布该项目 - AddItem。它抛出了一个错误,如下所示。你能否就此展示一些亮点。
注意 - 我可以在ebay电机中手动添加项目,具有相容性。我使用api调用GetItem获取了项目详细信息(手动添加)。在AddItem api调用中放置相同的详细信息。虽然失败了以下错误。
<ShortMessage>Category is not valid.</ShortMessage>
<LongMessage>The category is not valid, select another category.</LongMessage>
<ErrorCode>107</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
请求消息是
<?xml version="1.0" encoding="UTF-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>********PG1QKFIlH****</eBayAuthToken>
</RequesterCredentials>
<Version>967</Version>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>Sample ebay motor brake fitment product</Title>
<Description>Hummer Truck Right Side Mirror</Description>
<StartPrice currencyID="USD">236.0</StartPrice>
<Country>US</Country>
<Currency>USD</Currency>
<ListingDuration>Days_7</ListingDuration>
<Location>Los Angeles, California</Location>
<DispatchTimeMax>2</DispatchTimeMax>
<ConditionID>1000</ConditionID>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>w*****1@gmail.com</PayPalEmailAddress>
<Quantity>1</Quantity>
<PrimaryCategory>
<CategoryID>33562</CategoryID>
</PrimaryCategory>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
<GalleryURL>http://****/z/QJsAAOSwXSJXPHk~/$_1.JPG?set_id=880000500F</GalleryURL>
<PhotoDisplay>PicturePack</PhotoDisplay>
<PictureURL>http://*****/z/QJsAAOSwXSJXPHk~/$_1.JPG?set_id=880000500F</PictureURL>
</PictureDetails>
<ShippingDetails>
<ApplyShippingDiscount>false</ApplyShippingDiscount>
<GlobalShipping>true</GlobalShipping>
<CalculatedShippingRate>
<WeightMajor measurementSystem="English" unit="lbs">0</WeightMajor>
<WeightMinor measurementSystem="English" unit="oz">0</WeightMinor>
</CalculatedShippingRate>
<ShippingServiceOptions>
<ShippingService>ShippingMethodStandard</ShippingService>
<ShippingServiceCost currencyID="USD">0.0</ShippingServiceCost>
<ShippingServicePriority>1</ShippingServicePriority>
<ExpeditedService>false</ExpeditedService>
<ShippingTimeMin>1</ShippingTimeMin>
<ShippingTimeMax>6</ShippingTimeMax>
<FreeShipping>true</FreeShipping>
</ShippingServiceOptions>
<ShippingType>Flat</ShippingType>
<ThirdPartyCheckout>false</ThirdPartyCheckout>
<TaxTable>
<TaxJurisdiction>
<JurisdictionID>CA</JurisdictionID>
<SalesTaxPercent>10.0</SalesTaxPercent>
<ShippingIncludedInTax>false</ShippingIncludedInTax>
</TaxJurisdiction>
</TaxTable>
<ShippingDiscountProfileID>0</ShippingDiscountProfileID>
<InternationalShippingDiscountProfileID>0</InternationalShippingDiscountProfileID>
<ExcludeShipToLocation>Alaska/Hawaii</ExcludeShipToLocation>
<ExcludeShipToLocation>US Protectorates</ExcludeShipToLocation>
<ExcludeShipToLocation>APO/FPO</ExcludeShipToLocation>
<ExcludeShipToLocation>Africa</ExcludeShipToLocation>
<ExcludeShipToLocation>Asia</ExcludeShipToLocation>
<ExcludeShipToLocation>Central America and Caribbean</ExcludeShipToLocation>
<ExcludeShipToLocation>Europe</ExcludeShipToLocation>
<ExcludeShipToLocation>Middle East</ExcludeShipToLocation>
<ExcludeShipToLocation>Oceania</ExcludeShipToLocation>
<ExcludeShipToLocation>Southeast Asia</ExcludeShipToLocation>
<ExcludeShipToLocation>South America</ExcludeShipToLocation>
<ExcludeShipToLocation>BM</ExcludeShipToLocation>
<ExcludeShipToLocation>GL</ExcludeShipToLocation>
<ExcludeShipToLocation>MX</ExcludeShipToLocation>
<ExcludeShipToLocation>PM</ExcludeShipToLocation>
<ExcludeShipToLocation>PO Box</ExcludeShipToLocation>
<SellerExcludeShipToLocationsPreference>true</SellerExcludeShipToLocationsPreference>
</ShippingDetails>
<ReturnPolicy>
<RefundOption>MoneyBack</RefundOption>
<Refund>Money Back</Refund>
<ReturnsWithinOption>Days_14</ReturnsWithinOption>
<ReturnsWithin>14 Days</ReturnsWithin>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<ReturnsAccepted>Returns Accepted</ReturnsAccepted>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<ShippingCostPaidBy>Buyer</ShippingCostPaidBy>
<RestockingFeeValue>No</RestockingFeeValue>
<RestockingFeeValueOption>NoRestockingFee</RestockingFeeValueOption>
</ReturnPolicy>
<ItemCompatibilityList>
<Compatibility>
<NameValueList/>
<NameValueList>
<Name>Year</Name>
<Value>2008</Value>
</NameValueList>
<NameValueList>
<Name>Make</Name>
<Value>Workhorse Custom Chassis</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>R26</Value>
</NameValueList>
<NameValueList>
<Name>Trim</Name>
<Value>Base Motor Home - Stripped Chassis</Value>
</NameValueList>
<NameValueList>
<Name>Engine</Name>
<Value>8.1L 496Cu. In. V8 GAS OHV Naturally Aspirated</Value>
</NameValueList>
<CompatibilityNotes></CompatibilityNotes>
</Compatibility>
<Compatibility>
<NameValueList/>
<NameValueList>
<Name>Year</Name>
<Value>1998</Value>
</NameValueList>
<NameValueList>
<Name>Make</Name>
<Value>Advance Mixer</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>M</Value>
</NameValueList>
<NameValueList>
<Name>Trim</Name>
<Value>Base Straight Truck - Half Cab</Value>
</NameValueList>
<NameValueList>
<Name>Engine</Name>
<Value>-- DIESEL</Value>
</NameValueList>
<CompatibilityNotes></CompatibilityNotes>
</Compatibility>
<Compatibility>
<NameValueList/>
<NameValueList>
<Name>Year</Name>
<Value>1988</Value>
</NameValueList>
<NameValueList>
<Name>Make</Name>
<Value>Yugo</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>GVS</Value>
</NameValueList>
<NameValueList>
<Name>Trim</Name>
<Value>Base Hatchback 3-Door</Value>
</NameValueList>
<NameValueList>
<Name>Engine</Name>
<Value>1.1L 1116CC l4 GAS SOHC Naturally Aspirated</Value>
</NameValueList>
<CompatibilityNotes></CompatibilityNotes>
</Compatibility>
<Compatibility>
<NameValueList/>
<NameValueList>
<Name>Year</Name>
<Value>1963</Value>
</NameValueList>
<NameValueList>
<Name>Make</Name>
<Value>Wolseley</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>1500</Value>
</NameValueList>
<NameValueList>
<Name>Trim</Name>
<Value>Base</Value>
</NameValueList>
<NameValueList>
<Name>Engine</Name>
<Value>1.5L 1489CC 91Cu. In. l4 GAS OHV Naturally Aspirated</Value>
</NameValueList>
<CompatibilityNotes></CompatibilityNotes>
</Compatibility>
<Compatibility>
<NameValueList/>
<NameValueList>
<Name>Year</Name>
<Value>1928</Value>
</NameValueList>
<NameValueList>
<Name>Make</Name>
<Value>Yellow Cab</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>Model D-1</Value>
</NameValueList>
<NameValueList>
<Name>Trim</Name>
<Value>Base</Value>
</NameValueList>
<NameValueList>
<Name>Engine</Name>
<Value>--</Value>
</NameValueList>
<CompatibilityNotes></CompatibilityNotes>
</Compatibility>
</ItemCompatibilityList>
</Item>
</AddItemRequest>
答案 0 :(得分:2)
确保使用100
作为HTTP标头X-EBAY-API-SITEID
的值。这可确保您的请求被路由到类别有效的eBay电机站点。在标题中使用0
将请求路由到ebay.com,其中类别无效。