I am trying to fetch the contacts data from hubspot using Angular 9 but i am getting below error also all the suggestions are checked by the community people but still the error persist please help me to resolve the below error.
Access to XMLHttpRequest at ‘https://api.hubapi.com/crm/v3/objects/contacts’ from origin ‘https://localhost:44475’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
home.component.ts:31 GET https://api.hubapi.com/crm/v3/objects/contacts net::ERR_FAILED 401
Hi @PManasingh 
This has been covered in the HubSpot Community previously. See the following posts with accepted solutions:
- https://community.hubspot.com/t5/APIs-Integrations/CORS-issue/m-p/304553
- https://community.hubspot.com/t5/APIs-Integrations/How-to-fix-cors-is-not-allowing-API-request-issue/m-p/459610
The key piece of related HubSpot documentation can be reviewed here. Effectively, due to security concerns, the great majority of HubSpot API endpoints do not accept requests made from web browsers. You’ll need to handle most requests to HubSpot APIs via the backend.
I hope that proves useful. Please let me know if you have any follow-up questions.