As the title suggests, I can successfully use API calls through Postman, but when I try to use my local widget (running locally with zet cli - I copied the javaScript Fetch code snippet from Postman and inserted it into my extension.js file in the widget) I get the following error: 'Refused to connect to '
https://books.zoho.com/api/v3/organizations' because it violates the following Content Security Policy directive: "connect-src https://*.zohostatic.com https://*.sigmausercontent.com".'
I am trying to make a widget that will use the Books API to easily transfer items from one warehouse to another, especially in the case where we don't have an item in stock that is required in a bundle (since in this case we would need to transfer every item manually).
Here is the code being run from my local ZET CLI widget just to test the API calls. It works in Postman but not in my widget (I have been sure to update the oauthtoken after it expires):
console.log(getItemIdSKU(SKU));
function getItemIdSKU(SKU)
{
var myHeaders = new Headers();
myHeaders.append("Authorization", "Zoho-oauthtoken 1000.xxxxxxxxxxxxxeadebada2950e.xxxxxxxxxxxx0e4a064078f706b");
myHeaders.append("Cookie", "JSESSIONID=xxxxxxxxxx; _zcsr_tmp=xxxxxxxxxxxxxx; ba05f91d88=d11eaf0819c29xxxxxf83667dc957; zbcscook=cc2949ae-xxxx-xxxx-xxxx-xxxxxxxxx");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
return false;
}