Cross-Domain JavaScript Requests
Often, browsers prevent access to certain servers due to security restrictions. Cross-Domain JavaScript Requests allow developers to work around security restrictions that would prevent an application from contacting EV Charging Stations API directly. For example, certain location information might not be retrievable without enabling this method. In order to allow full access to servers, the EV Charging Stations API provides a mechanism to enable client-side cross-origin requests that allow JavaScript resources to be fetched from another domain.
For details on how this mechanism operates, see Cross-Origin Resource Sharing. EV Charging Stations API currently uses all headers and parameters of this mechanism.
In order to support browser platforms which do not yet implement Cross-Origin Resource Sharing, GET requests can alternatively be made using JSONP. To use JSONP, your application simply supplies the name of its callback function in the jsoncallback
or jsonpCallback
query string parameter.
For example, to use JSONP to search EV stations with a callback named myCallbackFunction, you could make a request using a bearer token like the example below:
GET https://ev-v2.cc.api.here.com/ev/stations.json
?prox=52.516667,13.383333,5000
&jsoncallback=myCallbackFunction
-H "Authorization: Bearer{YOUR_TOKEN}'
Using an API Key
GET
https://ev-v2.cc.api.here.com/ev/stations.json
?prox=52.516667,13.383333,5000
&jsoncallback=myCallbackFunction&apiKey={YOUR_API_KEY};