CORS issues when connecting to the API

Hi,

I am trying to use the Smartsuite API, it does work well with curl, but JS implementation fails in browser:

Access to fetch at 'https://app.smartsuite.com/api/v1/applications/*****/records/list/?offset=0&limit=3' from origin 'http://127.0.0.1:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

However, the same JS code works well when I run it in dev tools console from the API documentation page (https://api-docs.smartsuite.com/docs/en/*******/solution/*******#introduction).

Is there something I am doing wrong?

Thanks ๐Ÿ™‚

3 replies