How to search contacts from the contact list with more than 100 records in Freshsales?

Our detail use case:

  1. We have 1000 contacts and leads in the Freshsales account/domain
  2. We want to search for the contact which has the name is “Emma” and the number order of “Emma” is 400 out of the contact list
  3. We try to search by typing the keyword “Emma” in the search bar of the phone widget
  4. We could not see the result with Emma due to the limit (Only displayed and can be searched in first 100 contacts)

Please guide us.

2 Likes

Hi Emma,

Search API for Contacts can have results maximum of 100 records per page when search query was executed via API. If the search query is specific, the contact in any position should appear in the API response before 100 results.

If it doesn’t work this way, could you share the API URL used?

2 Likes

Here is our API, please revise
Request:
[cloud-cmctelecom.freshsales.io/api/search?q=cuong&include=lead,contact&per_page=25]

Received Response:

[
    {
        "id": "15001577425",
        "name": "Cuonglv",
        "owner": {
            "id": 15000014465,
            "name": "cuong le"
        },
        "updated_at": "2020-09-11T10:57:05+07:00",
        "type": "contact"
    },
    {
        "id": "15001506674",
        "name": "Chị Cương",
        "email": "[09081940740@email.com](mailto:09081940740@email.com)",
        "updated_at": "2020-09-09T10:11:11+07:00",
        "type": "contact"
    },
    {
        "id": "15001506125",
        "name": "Nguyễn Lê Cường",
        "email": "[09326898850@email.com](mailto:09326898850@email.com)",
        "updated_at": "2020-09-09T09:30:53+07:00",
        "type": "contact"
    },
    {
        "id": "15001520387",
        "name": "Thái Việt Cường",
        "email": "[09859075770@email.com](mailto:09859075770@email.com)",
        "updated_at": "2020-09-09T12:42:05+07:00",
        "type": "contact"
    },
    {
        "id": "15001521685",
        "name": "TRẦN QUỐChị CƯỜNG",
        "email": "[09063813550@email.com](mailto:09063813550@email.com)",
        "updated_at": "2020-09-09T12:48:01+07:00",
        "type": "contact"
    },
    {
        "id": "15001508185",
        "name": "NGUYỄN KHẮChị CƯỜNG",
        "email": "[03877873810@email.com](mailto:03877873810@email.com)",
        "updated_at": "2020-09-09T11:48:16+07:00",
        "type": "contact"
    },
    {
        "id": "15001507412",
        "name": "Dương hùng Cường",
        "email": "[08881890810@email.com](mailto:08881890810@email.com)",
        "updated_at": "2020-09-09T10:59:54+07:00",
        "type": "contact"
    },
    {
        "id": "15001506103",
        "name": "Lê Văn Cường",
        "updated_at": "2020-09-21T11:14:36+07:00",
        "type": "contact"
    },
    {
        "id": "15001523278",
        "name": "Vũ ĐứChị Cường",
        "email": "[08993180050@email.com](mailto:08993180050@email.com)",
        "updated_at": "2020-09-09T13:06:59+07:00",
        "type": "contact"
    },
    {
        "id": "15001508413",
        "name": "NGUYỄN THỊ KIM CƯỜNG",
        "email": "[03942239270@email.com](mailto:03942239270@email.com)",
        "updated_at": "2020-09-09T12:02:31+07:00",
        "type": "contact"
    },
    {
        "id": "15002294704",
        "name": "Cường lv",
        "owner": {
            "id": 15000014465,
            "name": "cuong le"
        },
        "updated_at": "2020-09-18T10:13:52+07:00",
        "type": "lead"
    }
]

@khucngoc12 I have meant the same API. The maximum records per page can only be 100 for this API. But, the record order doesn’t matter. If the search query string matches, the result will appear in the result.

If you still have an issue, could you describe it in detail again?

Hi @khucngoc12,

If you don’t see the contact that you need, in this case Emma in first 100 results when queried, that means freshsales has more than 100 results on name: Emma as contact/lead.

Which sounds less likely to be true, but can you confirm if that is the case?

Got your ideas. And our case is exactly as your descriptions.
We are doing this way to resolve:

  1. Divide all contacts (lead/customer) into multiple pages (100 contact/page)
  2. Search by a string at all pages to get all results
  3. Get the user ID without a phone number
  4. Fetch detailed contact by user ID to get a phone number that is associated with the contact

My assumption:

  • a contact can have multiple phone numbers, so they need to select one which they would like to call
  • 100 results per page. if we got 5,000, we just need 50 api requests to scan and 1 other to fetch the detail. With this way, we can resolve the api limits as mention before

@khucngoc12 I think, you have misunderstood that the search will only be done on 100 contacts/leads. You don’t have to do the search with a search term manually after fetching the results from this API.

The search term can be accurate so that the contacts/leads with the given search term will be lesser than 100 records. This search API does searches the contacts across all the records. But, only the returned result is limited to 100 records. There’s no pagination available to fetch the searched results more than 100.

1 Like