Using session key when using REST API , thus no map control RRS feed

  • Question

  • to follow best practices , how does one get the session key when not using an actual map control ?


    using REST API to geocode in .NET code , but  no map control present or needed .

    i would think maybe a REST API call that looking like :   Auth(INPUT : bing key ) OUTPUT: sessionKey


    Wednesday, July 6, 2016 9:09 PM


  • Session keys can only be created and used when using one of the interactive Bing Maps controls. Session keys cannot be used on their own with the services, only as part of a user experience which includes one of the interactive map controls. Session keys are an incentive for using and displaying one of the Bing Maps controls.

    If you have a lot of addresses to geocode from .NET, you can use the batch geocoding service for Bing Maps. The first 1 Million addresses a years it processes are free when you have an enterprise license for Bing Maps. Here is some documentation on this service: Note that this is a batch service, so it takes time to process requests, anywhere from several minutes to a couple of hours depending on the number of addresses uploaded and the demand on the service.

    If you need to geocode data on demand and have responses ASAP, then the REST location API is what you would want to use. However, this only processes a single address at a time and generates a transaction for each one. You could potentially load the Bing Maps WPF control in your app and use it to generate a session key. If you do this, you will need to display the map for a few seconds at least to generate a session key, otherwise it won't return one.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, July 6, 2016 10:29 PM
    • Marked as answer by Rybolt Thursday, July 7, 2016 8:55 PM
    Wednesday, July 6, 2016 10:29 PM