Ebay API call via JS on Zapier doesn’t work

  Kiến thức lập trình

I have the following Ebay API call that has successfully worked on Postman
https://svcs.sandbox.ebay.com/services/search/FindingService/v1?Operation-Name=findItemsByKeywords&Service-Version=1.0.0&Security-AppName=PetrosBe-Sells-SBX-9ac2147f3-b674cf2c&Response-Data-Format=JSON&REST-Payload&keywords=laptop

While using the following Fetch JS code on Zapier,I got an error

const newOptions = {
    //...options,
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer v^1.1#i^1#r^1#f^0#p^3#I^3#t^Ul4xMF81OjJGMzkwOTNCQTMzREM3OTJDMDNGODlFMTk5REM3MzY1XzBfMSNFXjEyODQ=`,
    },
}
const res = await fetch('https://svcs.sandbox.ebay.com/services/search/FindingService/v1?Operation-Name=findItemsByKeywords&Service-Version=1.0.0&Security-AppName=xxx&Response-Data-Format=JSON&REST-Payload&keywords=laptop', newOptions);
const json = await res.json();
return json;

I have tried troubleshooting via Zapier, and tested on Postman and it is working. I expect the code to execute the API to search with sandbox account for specific keyword.

I need someone to help me identify the issue.

LEAVE A COMMENT