我正在通过 createUploadJob 向 BulkDataExchangeRequests 发送 AddFixedPriceItemRequest 来测试对eBay API的LMS端的请求。
当我这样做时,我得到错误:“UUID是必需的”,即使在我可以找到的文档中说UUID是可选的。但是,我在通话体中包含了一个UUID。
对于我的生活,我找不到整个API调用应该是什么样子的例子。包括标题。
我在Ruby中使用gems HTTParty和Builder为XML编写代码。我的其他调用工作正常,我验证了这是正在发送的实际XML。
以下是我的XML与标题信息的相似之处:
destination = 'https://webservices.sandbox.ebay.com/BulkDataExchangeService'
headers = {
"X-EBAY-API-COMPATIBILITY-LEVEL"=>"949",
"X-EBAY-API-DEV-NAME"=>"My dev name token",
"X-EBAY-API-APP-NAME"=>"App name token",
"X-EBAY-API-CERT-NAME"=>"Cert name token",
"X-EBAY-SOA-OPERATION-NAME"=>"createUploadJob",
"X-EBAY-SOA-SECURITY-TOKEN" => "My auth token",
"X-EBAY-API-SITEID"=>"0",
"Content-Type"=>"text/xml"}
<?xml version="1.0" encoding="utf-8"?>
<BulkDataExchangeRequests>
<Header>
<SiteId>0</SiteId>
<Version>739</Version>
</Header>
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>My Auth token</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>Listing with a bunch of CSS but no JS</Title>
<Description>
<![CDATA[bunch of html]]>
</Description>
<PrimaryCategory>
<CategoryID>37565</CategoryID>
</PrimaryCategory>
<ConditionID>3000</ConditionID>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<Country>US</Country>
<Currency>USD</Currency>
<DispatchTimeMax>3</DispatchTimeMax>
<ListingDuration>Days_7</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>todd@piedmontred.com</PayPalEmailAddress>
<PictureDetails>
<PictureURL>http://s18.postimg.org/ocjdgkfrt/4_pack.jpg</PictureURL>
</PictureDetails>
<PostalCode>28211</PostalCode>
<ItemSpecifics>
<NameValueList>
<Name>Brand</Name>
<Value>Nike</Value>
</NameValueList>
<NameValueList>
<Name>Model</Name>
<Value>Odyssey</Value>
</NameValueList>
</ItemSpecifics>
<Variations>
<VariationSpecificsSet>
<NameValueList>
<Name>Size</Name>
<Value>XS</Value>
<Value>Large</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Black</Value>
<Value>Pink</Value>
</NameValueList>
</VariationSpecificsSet>
<Variation>
<SKU>my_first_sku</SKU>
<StartPrice>35.99</StartPrice>
<Quantity>5</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>XS</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Black</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
<Variation>
<SKU>my_second_sku</SKU>
<StartPrice>38.99</StartPrice>
<Quantity>6</Quantity>
<VariationSpecifics>
<NameValueList>
<Name>Size</Name>
<Value>Large</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Pink</Value>
</NameValueList>
</VariationSpecifics>
</Variation>
<Pictures>
<VariationSpecificName>Color</VariationSpecificName>
<VariationSpecificPictureSet>
<VariationSpecificValue>Black</VariationSpecificValue>
<PictureURL>http://thecodeplayer.com/uploads/s.jpg</PictureURL>
<PictureURL>http://thecodeplayer.com/uploads/1.jpg</PictureURL>
</VariationSpecificPictureSet>
<VariationSpecificPictureSet>
<VariationSpecificValue>Pink</VariationSpecificValue>
<PictureURL>http://thecodeplayer.com/uploads/mediaB.jpg</PictureURL>
<PictureURL>http://thecodeplayer.com/uploads/mediadx.jpg</PictureURL>
</VariationSpecificPictureSet>
</Pictures>
</Variations>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<Description>This is just a description for the return
policy</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSMedia</ShippingService>
<ShippingServiceCost>2.50</ShippingServiceCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>US</Site>
<UUID>8deb51e81bdc4b8eb136f92b746dd898</UUID>
</Item>
答案 0 :(得分:3)
基于您在上面提供的XML;看来你混淆了LMS的本质。
这意味着您不得在 createUploadJob 中包含Item
有效负载。 (见Ebay Documentation)。
一般来说,你必须:
跟着: