MapQuest API key no longer working

2019-07-23 14:09发布

问题:

We have been using a MapQuest API key for a few years now but at some point in the last 24hrs or so the maps have stopped working and we are getting an error: "This key is not authorized for this service."

I logged in and it appeared our old key was removed and automatically generated a new key for the new Open Maps API.

I have since waited over an hour and still this new API key is giving this error message.

Does anyone know what the story is?

回答1:

It seems like they have changed the URL for their API and failed to keep the old one operational. -Even in the AppKey manager they still reference the old URL yet looking in the new SDK documentation the API url has changed to a new subdomain.

To resolve my issue, I changed the URL for the MapQuest Javascript library from http(s)://mapquestapi.com/ to http(s)://open.mapquestapi.com/

You can use either http:// or https:// depending on whether you prefer performance or security.

The end result, at least for their Javascript SDK, should look something like this:

<script src="https://open.mapquestapi.com/sdk/js/v7.2.s/mqa.toolkit.js?key=<%= APIKey %>" type="text/javascript"></script>

EDIT: I also needed to use the new API key that was so kindly 'given' to me to replace the old one. Seems like they didn't pull all the old API keys accross and simply issued new ones to everone in response to their licensing changes.



标签: mapquest