Search company by partial name with REST API

We’re making a webform for customers to sign-up for newsletters/trials. One of the fields in the form is company name, and we want to associate the new contact with the company when the form is submitted. For this the new contact JSON object should contain companyID as "company": {"id": ...}, which I tried and it works. To get the companyId though I need to use the List Companies API with the company_name parameter.

The issue is that the API returns exact (case insensitive) matches of company_name, meaning if the user enters Trident as their company and our Infusionsoft DB has the company name stored as Trident Limited it returns no matches. I also tried using * and % as wildcards (trident*) but that didn’t work either. How can I get the REST API to return results of partial matches?

On a related note, is there any guidance/common pattern to match variations of company names, like Trident Ltd and Trident Limited?

This is both a technical and a UX matter and personally, I’d provide them a drop down of available company names to pick from and an add company option if theirs isn’t found.

Alternatively, you can use a non-REST api function to do a query on the company table using the wildcards you tried with REST (they don’t work the same in REST but do on the query method of the api), which can use the same access token you’re using for REST.

Those are really the only two practical workups I’ve come up with to resolve that issue :wink:

I agree that dropdown + add button is the best combination of UX and data correctness, so we will consider that solution. There are a couple of small issues though: 1. Users can see the entire list of companies we’ve worked with or are pursuing, and 2. we would ideally have to keep the list clean all the time - no test companies, duplicates, etc.
@Keap, If this functionality were available on Web Forms, it would be great btw.

I’ve never used the non-REST APIs. Do you mean xml-rpc - Keap Developer Portal?
@Keap, can the partial search functionality be expected to become available on REST APIs also?