Monday, 9 February 2015

How to call ebay xml API from Parse cloud



I wrote code to call ebay xml API from parse cloud, but I kept getting the error saying 'Unsupported API call.The API call "GetMyeBaySellingRequest" is invalid or not supported in this release.'


I tried the same request body using ebay API's test tool(http://ift.tt/1xMkc8S), it actually works fine. The version number i used in my header is the same as the test tool.



var headers = {
'X-EBAY-API-COMPATIBILITY-LEVEL': request.params.version,
'X-EBAY-API-DEV-NAME' : request.params.dev_key,
'X-EBAY-API-APP-NAME': request.params.app_key,
'X-EBAY-API-CERT-NAME': request.params.cert_key,
'X-EBAY-API-CALL-NAME': request.params.call_name,
'X-EBAY-API-SITEID' : "0",
'Content-Type': 'text/xml'
};
Parse.Cloud.httpRequest({
method: 'POST',
url: request.params.url,
headers: headers,
body: request.params.request_body,
success: function(httpResponse) {
console.log(httpResponse.text);
response.success(httpResponse.text);
},
error: function(httpResponse) {
console.error('Request failed with response code ' + httpResponse.status);
response.error('Request failed with response code ' + httpResponse.status);
}
});


Please help. Thanks.


No comments:

Post a Comment