Hoover's API Forums

Ask a Question

RSS Feed

how to set CountryNavigation in FindCompanyByKeyword

  1. I am using Find Company By Keyword Search
    I want to set countryNavigationValue.
    How to this? ("set CountryNavigation in FindCompanyByKeyword")


    i m using bellow mention code

    FindCompanyByKeywordRequestDocument requestDocument = FindCompanyByKeywordRequestDocument.Factory.newInstance();

    FindCompanyByKeywordRequest byKeywordRequestDocument = requestDocument.addNewFindCompanyByKeywordRequest();
    byKeywordRequestDocument.setKeyword(HOOVERS);
    byKeywordRequestDocument.addNewSearchNavigation().addNewLocationSearchNavigation().addNewCountryNavigation().setCountryNavigationValue("United States");

    in response i am getting "Invalid Search Criteria"

    Please guide me.
    Thanks

  2. ojas4 months ago

    To use navigators, you first need to set FindCompanyByKeywordRequest's returnSearchNavigation to true. This will populate the navigators object under FindCompanyByKeywordResponse/return. Underneath it, you will find multiple navigators (including countryNavigator) and also notice all navigators have a value and description. For example, here's a locationNavigators/ countryNavigators/ countryNavigator/ for US:

    <sch:countryNavigatorValue>76</sch:countryNavigatorValue>
    <sch:countryNavigatorDescription>United States (8624)</sch:countryNavigatorDescription>

    The countryNavigatorValue (in this case 76) is what you want to to pass back into FindCompanyByKeywordRequest/ reqsearchNavigation/ locationSearchNavigation/ countryNavigation/ countryNavigationValue. You can use the description for display purposes. The number in the parenthesis indicates the number of companies that are in the given navigator.

    So, the main idea is to set returnSearchNavigation to true in your request, display one or more of the navigators returned in the response in your UI, then when a navigator is selected in the UI, send its value back in the next request.

    Let us know if there's anything else we could help clear up.