# Search company by partial name with REST API

**URL:** <https://integration.keap.com/t/search-company-by-partial-name-with-rest-api/72526>\
**Category:** API Q&A\
**Tags:** api\
**Created:** [November 1, 2019, 12:21pm UTC](https://integration.keap.com/t/search-company-by-partial-name-with-rest-api/72526 "2019-11-01T12:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilanjana\_Mitra](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/nilanjana_mitra/32/12052_2.png) [@Nilanjana\_Mitra](https://integration.keap.com/u/Nilanjana_Mitra)\
**Post date:** [November 1, 2019, 12:21pm UTC](https://integration.keap.com/t/search-company-by-partial-name-with-rest-api/72526/1 "2019-11-01T12:21:13Z")

</div>

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](https://developer.infusionsoft.com/docs/rest/#!/Company/listCompaniesUsingGET) 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`?

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [November 1, 2019, 12:34pm UTC](https://integration.keap.com/t/search-company-by-partial-name-with-rest-api/72526/2 "2019-11-01T12:34:14Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![Nilanjana\_Mitra](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/nilanjana_mitra/32/12052_2.png) [@Nilanjana\_Mitra](https://integration.keap.com/u/Nilanjana_Mitra)\
**Post date:** [November 1, 2019, 1:19pm UTC](https://integration.keap.com/t/search-company-by-partial-name-with-rest-api/72526/3 "2019-11-01T13:19:02Z")

</div>

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](https://developer.infusionsoft.com/docs/xml-rpc/#data-query-a-data-table)?  
@Keap, can the partial search functionality be expected to become available on REST APIs also?
