How to integrate the Companies House API into a form for validation?
I'm mostly self-taught with web dev and with nobody else to ask for help with in-company, but I've been asked to work on something that I'm really struggling to figure out here.
Essentially, they want me to make a form for the clients to fill with their business info, and the first of the fields will be for the Company Number of their business, to which after typing in their number, it will connect to the Company House API to retrieve the available data on the input number... of which I believe to only really be the Companies' name and their status (whether they're dissolved or not essentially)
This is somewhat because they have a fascination with auto-filling any and all fields from previously filled data, but mostly they want this Company House API connection so as to be able to read the status of the company, and if the company is anything but still active, we want to basically stop them from continuing through the account creation.
The normal form stuff I can handle just fine, but I cannot figure out how to connect this with the Companies House API, having no experience with API's. And I can't find any resources either on their site or just in general online as to how to use it in quite this manner, or if it is even possible to do?
I tried reaching with some alternate methods to avoid the API solution, like with an iframe modal which is unfortunately blocked, and also with window.open() to then read the specific id of the company status to then just do JavaScript comparisons, but I couldn't get this to work — presuming it to be as it's cross-domain. Could I maybe be pointed towards some resources that might help me with this issue, or if it's something that is even possible to do? Preferably, we'd want this to work with as little extra software added into the mix as possible. Our product at the moment is mostly written in HTML with PHP elements where needed, and with a PHPMyAdmin database for storing account details.
I think this API in particular is the one we'd need to use for this solution, but I am really unsure as to how to implement it: [https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference)
I'm not sure if I'm just missing something obvious, I assume I am! But regardless, thank you in advance.