Question by $$anonymous$$ · Dec 11, 2014 at 12:47 AM · trading
Trading API GeteBayOfficialTime error code 10012
This was my attempt to use the GeteBayOfficialTime from the Trading API... I simply copied and pasted what worked from this site: https://developer.ebay.com/DevZone/build-test/test-tool/default.aspx and yet I'm getting a failure code... any ideas? It just so happens the GeteBayOfficialTime isn't on the top error codes list http://developer.ebay.com/DevZone/XML/docs/Reference/ebay/Errors/errorsByCall.html, my error code is 10012
This is the code:
function myFunction() {
var url = "https://api.sandbox.ebay.com/ws/api.dll";
var request = HtmlService.createHtmlOutputFromFile('xml').getContent();
var params = {
method:'get',
payload:request,
headers: {
"X-EBAY-API-COMPATIBILITY-LEVEL":851,
"X-EBAY-API-DEV-NAME":"replace",
"X-EBAY-API-APP-NAME":"replace",
"X-EBAY-API-CERT-NAME":"replace",
"X-EBAY-API-SITEID" :0,
"X-EBAY-API-CALL-NAME":"GeteBayOfficialTime"
}
}
var response = UrlFetchApp.fetch(url, params).getContentText();
//var object = xmlToJson(response);
Logger.log(response);
}
This is the XML file that the 3rd line from the above code refers to, again, everything is copied and pasted:
<?xml version="1.0" encoding="utf-8"?>
<GeteBayOfficialTimeRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>AgAAAA**AQAAAA**aAAAAA**triHVA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDZCEpgWdj6x9nY+seQ**jCIDAA**AAMAAA**/XPgXcRnaejGehkQ2nE0DIhDMwgoLxOTvGjNjrk11mjwaoKKEfHfkSaLi62yiWfSVdV00Tti80FO1EBRkLMks+PEmmBeaojuZypfWZw7AiuM9OkBkdl+wCrz/WzXfJ+N96aTC5lNZgb/sb1tO9YwonKsA0O+MJimIZVRXtliHOtUj++uESumlu/toPS5GEYAIZrlAe4FUDl+YMy58113zU/jP/eZ+AQrAPB0uopY6Kn16d/S2vkRBAG0+G/XZaEGT4rFWwsix5TgZfjfUozVu0WHcZN+8peIJYM3FLxuZceEbUcwrRXe/wFY4o0ICkTH+H2WHUQBoukhPuJJzHXS1DOGRpBkRRoFuPeI2HdhNHO0cjAWMhega9y7SJi7zShOkrUO4FfI6V5wSMhkU7GWjzmlCQLDjFJpo7R8KRLwqW1pECF9m4u8MPqHl3UxjAdny1VWUloAVD0HsZ0Y8mpOqR6gsZUQUYatAux6Fy3DvIGCSrQ38QVknOsrX5V3gF9QX5As0P4CnB2BvebsT0AHdiPfjWQ+BbqxZX9tDPKyz1fCNQ7BwJ7Loi5W9yOTK+ngO4p/VY/UbwLCI7FnKrBARcrXc1y4ghak29QIBXO/fm/29LUsKau5/1GUtbp1lLm9pB+MhXaKsieWg/bn/Z2p26ygGTNjLnAam5c2thR3YYbUIey1LcV6J6GvswfItHa0D5rThtx/RfwZTUiiamF7njpOAvhiZGh8gBZzfTzqbGHJZraGRWTiGN7loUaiURv3</eBayAuthToken>
</RequesterCredentials>
</GeteBayOfficialTimeRequest>
This is the response:
<?xml version="1.0" encoding="UTF-8"?>
<GeteBayOfficialTimeResponse xmlns="urn:ebay:apis:eBLBaseComponents"><Timestamp>2014-12-11T00:36:10.345Z</Timestamp><Ack>Failure</Ack><Errors><ShortMessage>Invalid value for header "X-EBAY-API-SITEID".</ShortMessage><LongMessage>Header "X-EBAY-API-SITEID" with value "0.0" is out of range.</LongMessage><ErrorCode>10012</ErrorCode><SeverityCode>Error</SeverityCode><ErrorParameters ParamID="0"><Value>X-EBAY-API-SITEID</Value></ErrorParameters><ErrorParameters ParamID="1"><Value>0.0</Value></ErrorParameters><ErrorClassification>RequestError</ErrorClassification></Errors><Errors><ShortMessage>Invalid value for header "X-EBAY-API-COMPATIBILITY-LEVEL".</ShortMessage><LongMessage>Header "X-EBAY-API-COMPATIBILITY-LEVEL" with value "851.0" is out of range.</LongMessage><ErrorCode>10012</ErrorCode><SeverityCode>Error</SeverityCode><ErrorParameters ParamID="0"><Value>X-EBAY-API-COMPATIBILITY-LEVEL</Value></ErrorParameters><ErrorParameters ParamID="1"><Value>851.0</Value></ErrorParameters><ErrorClassification>RequestError</ErrorClassification></Errors><Version>893</Version><Build>E893_CORE_API_17097905_R1</Build></GeteBayOfficialTimeResponse>
Answer by helios825 · Dec 11, 2014 at 05:58 AM
2 things to try, each of which may solve your problem:
1) Use Production instead of Sandbox. Endpoint: https://api.ebay.com/ws/api.dll
2) Make sure your header params include a colon within the quotes for each label, like:
X-EBAY-API-DEV-NAME:
X-EBAY-API-CERT-NAME:
People who like this
Your answer
