I need to have a form in my php page and this form is created in the hubspot. I have seen two options like embed the code (where we use a script and place this script below the html) and share link (where we will use this link for the form). I had tried with embed code and the form got displayed in the frontend. I think we need to do custom styling.
It is not possible to retrieve a HubSpot form's HTML source code directly via an API request. The endpoint you used is the closest you can get.
Using the JSON returned, you could reconstruct an HTML form with either PHP or JavaScript from the form's fields and then send the submission to this endpoint.
Alternatively, it might be simpler to just create a custom HTML form which has the same fields as the HubSpot form and use this endpoint to send the submissions to the HubSpot form.