EBay API: getMostWatchedItems returning RequestError - ebay-api

Based on the API documentation of EBay:
https://developer.ebay.com/devzone/merchandising/docs/CallRef/getMostWatchedItems.html
I made the following call:
<?xml version="1.0" encoding="UTF-8"?>
<getMostWatchedItems xmlns="http://www.ebay.com/marketplace/services">
<maxResults>3</maxResults>
</getMostWatchedItems>
With the following headers:
X-EBAY-API-COMPATIBILITY-LEVEL 967
X-EBAY-API-CALL-NAME getMostWatchedItems
X-EBAY-API-SITEID 15
Content-Type text/xml
But it returns the following response:
<?xml version="1.0" encoding="UTF-8" ?>
<eBay>
<EBayTime>2018-11-09 03:20:27</EBayTime>
<Errors>
<Error>
<Code>2</Code>
<ErrorClass>RequestError</ErrorClass>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ShortMessage>
<![CDATA[ Unsupported verb. ]]>
</ShortMessage>
</Error>
</Errors>
</eBay>
Does anyone encounter the same issue? Thanks for the help.

<?xml version="1.0" encoding="UTF-8" ?>
<getMostWatchedItemsResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2018-11-09 18:23:12</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Unsupported API call.</ShortMessage>
<LongMessage>The API call "getMostWatchedItems" is invalid or not supported in this release.</LongMessage>
<ErrorCode>2</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>967</Version>
<Build>18863825</Build>
</getMostWatchedItemsResponse>
It appears that getMostWatchedItems is not supported by the 967 version of the eBay API.

You're not using the correct headers. Your headers look like they're for the Shopping API, which this call (gMWI) is not part of.
For 1 thing, you don't use SiteID in gMWI. You use Global IDs.
Have a look at this Merchandising API tutorial, especially the Standard Headers section.

Related

Davical Sync-Token web request

I am trying not to re-invent the wheel here...
I have found some nice documentation on CalDav sync implementation there
According to its website, DaviCal is rfc6578-compliant since v. 0.9.8 (see here).
I therefore first send my request to get the sync token as follows:
PROPFIND http://my_cal_srv/user/calendar_path HTTP/1.1
Content-Type: application/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<d:propfind xmlns:d='DAV:'>
<d:prop>
<d:displayname />
<d:sync-token />
</d:prop>
</d:propfind>
This returns data as expected:
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>/caldav.php/user/calendar_path/</href>
<propstat>
<prop>
<displayname>My Calendar</displayname>
<sync-token>data:,9</sync-token>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
So far so good, I have a token, it's "data: ,9". So, let's just try to get changes since 8, the token I had when I queried the server prior to adding some event.
REPORT http://my_cal_srv/user/calendar_path HTTP/1.1
Content-Type: application/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<d:sync-collection xmlns:d="DAV:">
<d:sync-token>8</d:sync-token>
<d:sync-level>1</d:sync-level>
<d:prop>
<d:getetag/>
</d:prop>
</d:sync-collection>
The answer is:
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>/caldav.php/user/path/86166f9c-3e2e-4242-9a28-0f3bfb1dd67a-caldavsyncadapter.ics</href>
<propstat>
<prop>
<getetag>"5ed2101b0c867e490dbd71d40c7071bb"</getetag>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<response>
<href>/caldav.php/user/path/cb354fab-b41d-49ad-8a4f-8d68c9090ea0.ics</href>
<propstat>
<prop>
<getetag>"334892703f4151024e9232eab9b515a7"</getetag>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>data:,9</sync-token>
</multistatus>
After deleting an entry (so I get sync-token 10, and still compare using token 8), I get following result :
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>/caldav.php/user/cal_path/86166f9c-3e2e-4242-9a28-0f3bfb1dd67a-caldavsyncadapter.ics</href>
<status>HTTP/1.1 404 Not Found</status>
</response>
<response>
<href>/caldav.php/user/cal_path/cb354fab-b41d-49ad-8a4f-8d68c9090ea0.ics</href>
<propstat>
<prop>
<getetag>"334892703f4151024e9232eab9b515a7"</getetag>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<sync-token>data:,10</sync-token>
</multistatus>
So I am a little confused here as I don't really know how to interpret these results...
Could anybody please explain to me how to extract the sync info from here? It is a little hard to figure out the changes types because the ICS namings are unclear...
Thanks in advance for helping out... And merry X-Mas !
Regards,
N.
That you get a "data:,9" doesn't imply you can actually query "data:,8" or ,7 etc. Sync tokens are opaque and do NOT give you a versioning system (you need sth like DAV Versioning Extensions for that).
DAV sync-tokens are a simple optimization technique - nothing more. They are completely opaque to the client and the server can expire sync tokens at any time (and is not required to save tombstones and such). Eg a server which can't store tombstones can simply expire tokens on DELETE requests.
The way you use sync-tokens is:
to figure out which child collections of a parent collection need to be re-synced
to optimize syncing of a the resources within a child collection
1) Which child collections need to be synced
Assume you have a collection of calendars (e.g. my_cal_srv/user/) and you do a PROPFIND Depth:1 on this collection, asking for the sync-tokens of the child collections. If those don't match the ones of your clients cache anymore, you know you need to perform a sync of just those child collections.
Note: do NOT use the token you got back from this request to sync the child collection (which is what you do above). It might have expired already. Within sync-reports only use tokens you got from sync-reports!
2) Optimizing syncing of the collection contents
Again: sync-token's are an optimization, nothing more. You always need to be prepared to get an (in)valid-sync-token precondition error (which means the server expired the token) and do a full refetch of the collection contents! And then compare that (URL,ETag) to your cached version to figure out what the changes are. (essentially all the steps you need to do when you have a server which doesn't support sync-reports).
If you get a sync-token in the sync-report results, you can then use it in the next sync-request. If the server still has the state, it'll just give you the changes. If it expired the token, it'll give you the sync-token error.
Note: In case it isn't obvious - in the very first sync-request you don't (can't) provide a token. You run the query w/o a token and get back all the contents. You do the same again if the server sends you an (in)valid-sync-token error.
You're not doing a correct request. In your request you have:
<d:sync-token>8</d:sync-token>
But this should be:
<d:sync-token>data:,8</d:sync-token>
Aside from that, the first response you are getting tells you that:
These resources have been changed or newly created:
/caldav.php/user/path/86166f9c-3e2e-4242-9a28-0f3bfb1dd67a-caldavsyncadapter.ics
/caldav.php/user/path/cb354fab-b41d-49ad-8a4f-8d68c9090ea0.ics
The second response tells you:
This resource has been changed or newly created:
/caldav.php/user/cal_path/cb354fab-b41d-49ad-8a4f-8d68c9090ea0.ics
This resource has been deleted:
/caldav.php/user/cal_path/86166f9c-3e2e-4242-9a28-0f3bfb1dd67a-caldavsyncadapter.ics

eBay CompleteSale API giving error in response

I am using the following xml for eBay CompleteSale API call:
<?xml version="1.0" encoding="utf-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$auth_token</eBayAuthToken>
</RequesterCredentials>
<ItemID>$itemId</ItemID>
<TransactionID>$transId</TransactionID>
<FeedbackInfo>
<CommentText> string </CommentText>
<CommentType>Positive</CommentType>
<TargetUser></TargetUser>
</FeedbackInfo>
<Shipped>1</Shipped>
<Paid>1</Paid>
<ListingType>Half</ListingType>
<Shipment>
<ShipmentTrackingDetails>
<ShipmentTrackingNumber>$trackingNo</ShipmentTrackingNumber>
<ShippingCarrierUsed>$carrier</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShippedTime>$shippingDate</ShippedTime>
</Shipment>
<ErrorLanguage> string </ErrorLanguage>
<MessageID> string </MessageID>
<Version>889</Version>
<ErrorHandling>BestEffort</ErrorHandling>
<WarningLevel>Low</WarningLevel>
</CompleteSaleRequest>
When I run the script, the tracking number gets updated in the eBay correctly, but the response XML gives error:
<?xml version="1.0" encoding="UTF-8"?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2014-10-13T14:39:52.430Z</Timestamp>
<Ack>Failure</Ack>
<CorrelationID> string </CorrelationID>
<Errors>
<ShortMessage>Invalid shipment tracking number or carrier</ShortMessage>
<LongMessage>You have entered an incorrect shipment tracking number/carrier.</LongMessage>
<ErrorCode>2191111</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Tracking numbers invalid</ShortMessage>
<LongMessage>The following Tracking Numbers are invalid : TRACKING_NUMBER_VALUE.</LongMessage>
<ErrorCode>21916897</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorParameters ParamID="0">
<Value>TRACKING_NUMBER_VALUE</Value>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Internal error to the application.</ShortMessage>
<LongMessage>Internal error to the application.</LongMessage>
<ErrorCode>10007</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>An error occurred.</ShortMessage>
<LongMessage>An error number "{0}" occurred while processing your request.</LongMessage>
<ErrorCode>36</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>893</Version>
<Build>E893_CORE_APIXO_17070435_R1</Build>
</CompleteSaleResponse>
Why I am not getting the success in response?
The tracking Number is like: 1Z7X887R0368851221 and carrier is 'UPS'
Please help.
Thanks
Per eBay's own dev site:
Error 10007 ("Internal error to the application") indicates an error on the eBay server side, not an error in your application.
So you'd probably need to contact eBay about the specific issue, but my assumption is that while eBay will accept in any information into the Carrier and Tracking number fields, the format of the tracking number field must match some other critieria set by the carrier for inserting into another API upstream.
Have you tested the tracking number in UPS's own tracking mechanism? It returns a valid package tracking response?
Also, per the eBay dev site, if you are using UPS Mail Innovations rather than UPS, the carrier name to specifiy is UPS-MI.

Ebay API for listing one seller's items - GetSellerList

Anyone out there with experience with the Ebay API? I'm essentially trying to list all items for one shop on their website, so it's not going to be a public service usage. The GetSellerList method seems to be the way to go, but the documentation on the Ebay Website itself is very scant and not really well done at all.
http://developer.ebay.com/DevZone/XML/docs/reference/ebay/GetSellerList.html
I'm in the process of trying out the code samples and the problem I'm hitting now is whether or not I need a UserToken or not. #PITA
Thanks,
Here is about the minimum request I used that worked for me:
<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>--Enter your AuthToken here--</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<StartTimeFrom>2013-06-01T21:59:59.005Z</StartTimeFrom>
<StartTimeTo>2013-09-26T21:59:59.005Z</StartTimeTo>
<EndTimeFrom>2013-09-26</EndTimeFrom>
<EndTimeTo>2013-11-26</EndTimeTo>
<GranularityLevel>Coarse</GranularityLevel>
<UserID>--Enter your seller's name here--</UserID>
<Pagination>
<EntriesPerPage>200</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
<OutputSelector>ItemArray.Item.ItemID</OutputSelector>
<OutputSelector>ItemArray.Item.Quantity</OutputSelector>
<OutputSelector>ItemArray.Item.Title</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>
I also had to add these headers to the request:
X-EBAY-API-APP-NAME -- Add yours here --
X-EBAY-API-CALL-NAME GetSellerList
X-EBAY-API-REQUEST-ENCODING XML
X-EBAY-API-SITEID 0
X-EBAY-API-DEV-NAME -- Add yours here --
X-EBAY-API-CERT-NAME -- Add yours here --
X-EBAY-API-COMPATIBILITY-LEVEL 825
I'm not sure which of the "-- Add yours here --" entries are public and which are private, so I'll aire on the side of caution and I'll let you get them for yourself.. :-)
With no eBayAuthToken entered, you get the following error:
<Errors>
<ShortMessage>Auth token is invalid.</ShortMessage>
<LongMessage>Validation of the authentication token in API request failed.</LongMessage>
<ErrorCode>931</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
I hope this helps.
<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$authToken</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<StartTimeFrom>2015-01-01T00:00:00.005Z</StartTimeFrom>
<StartTimeTo>2015-03-31T23:59:59.005Z</StartTimeTo>
<EndTimeFrom>2015-03-31T23:59:59.005Z</EndTimeFrom>
<EndTimeTo>2015-05-31T23:59:59.005Z</EndTimeTo>
<GranularityLevel>Coarse</GranularityLevel>
<UserID>----testuser----</UserID>
<Pagination>
<EntriesPerPage>200</EntriesPerPage>
<PageNumber>1</PageNumber>
</Pagination>
<OutputSelector>ItemArray.Item.ItemID</OutputSelector>
<OutputSelector>ItemArray.Item.Quantity</OutputSelector>
<OutputSelector>ItemArray.Item.Title</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
<OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>
Header Request Values
$headers = array(
'X-EBAY-API-SITEID:'.SITEID,
'X-EBAY-API-CALL-NAME:GetSellerList',
'X-EBAY-API-REQUEST-ENCODING:'.RESPONSE_ENCODING,
'X-EBAY-API-COMPATIBILITY-LEVEL:' . API_COMPATIBILITY_LEVEL,
'X-EBAY-API-DEV-NAME:' . API_DEV_NAME,
'X-EBAY-API-APP-NAME:' . API_APP_NAME,
'X-EBAY-API-CERT-NAME:' . API_CERT_NAME,
'Content-Type: text/xml;charset=utf-8'
);

eBay : what value should be set for ShippingCostPaidByOption for return policy API

I'm working with ebay Trading API for listing the product but after I'm stucking in it where i need to set value for a option in Return policy Type API, I need to set ShippingCostPaidByOption with value either Paid by buyer or Paid by Seller?
Similarly I need to set RefundOption value either Money or Money or item replace.
To get the applicable RefundOption and ShippingCostPaidByOption values, call GeteBayDetails with DetailName set to ReturnPolicyDetails, and then look for the ReturnPolicyDetails.Refund.RefundOption and ReturnPolicyDetails.ShippingCostPaidBy.ShippingCostPaidByOption fields in the response. The value of the fields can be used in your AddItem request.
The following example can be used as a request to GeteBayDetails using the eBay API explorer.
<?xml version="1.0" encoding="utf-8"?>
<GeteBayDetailsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[ADD YOU OWN AUTH TOKEN</eBayAuthToken>
</RequesterCredentials>
<DetailName>ReturnPolicyDetails</DetailName>
</GeteBayDetailsRequest>
A typical response will look like the following.
<?xml version="1.0" encoding="UTF-8"?>
<GeteBayDetailsResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<ReturnPolicyDetails>
<Refund>
<RefundOption>MoneyBackOrExchange</RefundOption>
<Description>Money back or exchange (buyer's choice)</Description>
</Refund>
</ReturnPolicyDetails>
<ShippingCostPaidBy>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<Description>Buyer</Description>
</ShippingCostPaidBy>
</ReturnPolicyDetails>
</GeteBayDetailsResponse>

eBay API: GetOrders call returning no orders

I have placed test orders in the sandbox eBay account.
I am not able to get the orders listing from the GetOrders API call.
It retruns the success message but no orders are fetched.
Below are the API call details :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns="urn:ebay:apis:eBLBaseComponents" ><soap:Header><RequesterCredentials><eBayAuthToken>...</eBayAuthToken><Credentials><AppId>Clarion89-2b36-4da6-b073-00dafbcff12</AppId><DevId>f79169c1-f95b-4d23-9fe2-547504ffb827</DevId><AuthCert>...</AuthCert></Credentials></RequesterCredentials></soap:Header><soap:Body><GetOrdersRequest><DetailLevel>ReturnAll</DetailLevel><Version>527</Version><CreateTimeFrom>2012-04-02T09:52:27.000Z</CreateTimeFrom><CreateTimeTo>2012-05-03T09:52:27.000Z</CreateTimeTo><OrderRole>Seller</OrderRole><OrderStatus>Active</OrderStatus><ListingType>FixedPriceItem</ListingType></GetOrdersRequest></soap:Body></soap:Envelope>
Response returned as below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<GetOrdersResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2012-05-03T09:54:03.650Z</Timestamp>
<Ack>Success</Ack>
<Version>771</Version>
<Build>E771_CORE_BUNDLED_14795207_R1</Build>
<PaginationResult>
<TotalNumberOfPages>0</TotalNumberOfPages>
<TotalNumberOfEntries>0</TotalNumberOfEntries>
</PaginationResult>
<HasMoreOrders>false</HasMoreOrders>
<OrderArray/>
<OrdersPerPage>100</OrdersPerPage>
<PageNumber>1</PageNumber>
<ReturnedOrderCountActual>0</ReturnedOrderCountActual>
</GetOrdersResponse>
</soapenv:Body>
</soapenv:Envelope>
Please tell me why i am not getting order details
first of all i would use an higher version (i'm actually using 771 as compatibility level)
I used to have a similar problem at the very benning when i started coded for api, then i switched CreatedTime filter to NumberOfDays wich are the days to look back from today.
What language are you using to make the call?
Check your request parameters against your orders that are stored on ebay. It may happen that there are no orders matching the parameters you are entering in your call. Try entering the most basic request parameters like
<?xml version="1.0" encoding="utf-8"?>
<GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[your authentication token]</eBayAuthToken>
</RequesterCredentials>
<CreateTimeFrom>2012-05-10T00:00:00.000Z</CreateTimeFrom>
<CreateTimeTo>2012-05-15T00:00:00.000Z</CreateTimeTo>
</GetOrdersRequest>
You can enter the dates as per your requirement but make sure you use the date format accepted by ebay.