Encountered NO CORS policy error while updating ticket status
I have a hubspot website page on which i am showing the ticket detail. Now i need to update ticket details from that page and it should we updated on ticket record also. And I am getting NO CORS policy error when i hit the api to update ticket detail.
ERRROR -
Access to fetch at 'https://api.hubapi.com/crm/v4/objects/tickets' from origin 'https://22802714.hubspotpreview-na1.com' 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.
Encountered NO CORS policy error while updating ticket status
Hey @JSrivastava, Unfortunately, you cannot use the Design Tool to hit the API to update or insert records in the ticket module.
You will need to use a custom code solution to achieve this. You may also need to update your CORS policy to allow the API requests to be sent to your server.
We got your point can you please assist us how and where we can implement our custom code to hit an API on a button click which is on my HubSpot website page. Do you have any kind of reference link by which we can achieve this.
Encountered NO CORS policy error while updating ticket status
No @JSrivastava, it is not possible to hit an API in the page module of a design tool. The page module is used to create the structure of a page and to add content elements, such as text, images, videos, and forms. It does not have the capability to interact with an API.
Encountered NO CORS policy error while updating ticket status
Dear @JSrivastava , Perhaps you missed anything while trying to follow the suggestion. Please do double check.
And No, you cannot hit an API in the Design Tool (Page Module). You can, however, use the API to retrieve data or get information and then use that data or information to populate the page with content.