How do I add an optional id to the get search address batch request

Jones, Jacob 0 Reputation points
2023-01-20T21:45:37.35+00:00

I am looking for a way to add an optional id to each address when processing an address batch request. It looks like the geocoding batch allows it, but I do not see the option for an address batch request.

I am having issues joining the source address to the standardized address when sending a batch since the query is returned formated. The optional id will make the process easier.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
577 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SanthiSwaroopNaikBukke-4908 595 Reputation points
    2023-01-20T21:52:20.45+00:00

    The Azure Maps Search Address batch request allows you to search for multiple addresses in one request. The ID parameter is not included by default, but you can add it by including the id parameter in the query string.

    Here's an example of how you can add an optional ID to the Get Search Address batch request using the REST API:

    Copy code
    https://atlas.microsoft.com/search/address/batch/json?subscription-key={subscription-key}&id=1,2,3&query=Seattle
    

    In the above example, the id parameter is set to 1,2,3 and will be returned in the response along with the search results for each address.

    You can also use Azure Maps SDK to perform the same action.

    Copy code
    # Python SDK example
    search_batch_request = SearchBatchRequest(subscription_key=subscription_key)
    
    # Adding an optional ID to the request
    search_batch_request.add_address("Seattle", id=1)
    search_batch_request.add_address("New York", id=2)
    
    batch_response = search_batch_request.execute()
    

    In this example, the id parameter is set to 1 and 2 respectively for each address.

    Please keep in mind that ids must be unique across all requests in the same batch and that the id parameter is optional and can be omitted if not needed.

    0 comments No comments

  2. SanthiSwaroopNaikBukke-4908 595 Reputation points
    2023-01-20T21:52:53.58+00:00

    The Azure Maps Search Address batch request allows you to search for multiple addresses in one request. The ID parameter is not included by default, but you can add it by including the id parameter in the query string.

    Here's an example of how you can add an optional ID to the Get Search Address batch request using the REST API:

    Copy code
    https://atlas.microsoft.com/search/address/batch/json?subscription-key={subscription-key}&id=1,2,3&query=Seattle
    

    In the above example, the id parameter is set to 1,2,3 and will be returned in the response along with the search results for each address.

    You can also use Azure Maps SDK to perform the same action.

    Copy code
    # Python SDK example
    search_batch_request = SearchBatchRequest(subscription_key=subscription_key)
    
    # Adding an optional ID to the request
    search_batch_request.add_address("Seattle", id=1)
    search_batch_request.add_address("New York", id=2)
    
    batch_response = search_batch_request.execute()
    

    In this example, the id parameter is set to 1 and 2 respectively for each address.

    Please keep in mind that ids must be unique across all requests in the same batch and that the id parameter is optional and can be omitted if not needed.

    0 comments No comments