API calls work fine in Postman, but I get a security error when running the same call in my Zet CLI widget

API calls work fine in Postman, but I get a security error when running the same call in my Zet CLI widget

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;
}

Thank you for your time!




                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation


                                        Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl Resources


                                                              Zoho Creator Resources


                                                                Zoho WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • Functions

                                                                      Functions

                                                                    • Meetups

                                                                      Meetups

                                                                    • Kbase

                                                                      Kbase

                                                                    • Resources

                                                                      Resources

                                                                    • Digest

                                                                      Digest

                                                                    • CRM Marketplace

                                                                      CRM Marketplace

                                                                    • MVP Corner

                                                                      MVP Corner

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now