Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > SDKs >

getContacts using searchTerm returns 0 results

Started by Tim Brocklehurst -   in SDKs

I have a search-as-you type form in my app for users to find the contact they're generating a new quote for. So, providing they've entered 3 characters or more, it sends an ajax call to the PHP script attached, which returns the HTML for the search results.

When I run it with the $searchTerm variable as null, it returns 100 results (the first page).

However, when I pass the value of the search box (the characters entered by the user) it returns nothing (an empty object).

What am I doing wrong, please?

https://xeroapi.github.io/xero-php-oauth2/docs/v2/accounting/index.html#api-Accounting-getContacts

https://github.com/webinc/xero_api

https://github.com/webinc/xero_api/blob/main/xero_getContacts.php