英文:
Access EV Stations Detail for a Route or Geolocation Using Golang and HereApi
问题
我正在进行一个研发项目,旨在找出特定路线/地理位置周围的充电站。在尝试访问该URL时,我收到了凭据无效的错误消息。与此同时,我可以使用相同的API密钥访问其他一些服务,但无法访问电动汽车充电站。
请问如何使用凭据访问相同的内容?期待专家社区宝贵的反馈。以下是我使用Golang尝试的代码:
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
var apikey = "XXXXXXXX"
var latitude = 42.36399
var longitude = -71.05493
var address string
func main() {
url := "https://ev-v2.cc.api.here.com/ev/stations.json?prox=" + fmt.Sprint(latitude) + "," + fmt.Sprint(longitude) + ",5000&connectortype=31&apiKey=" + apikey
res, err := http.Get(url)
if err != nil {
log.Fatalln(err)
}
body, err := ioutil.ReadAll(res.Body)
if err != nil {
log.Fatalln(err)
}
fmt.Println(string(body))
}
英文:
I am working on an RND Project to find out the Charging stations around a particular route/geolocation, I am getting credentials not valid error message while trying to access the URL. Meanwhile some of the other services I am able to access with the same API Key but not the EV ones.
How can I access the same using the credentials, Looking forward to valuable feedback from the expert community. Here is what I have tried using Golang.
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
var apikey = "XXXXXXXX"
var latitude = 42.36399
var longitude = -71.05493
var address string
func main() {
url = "https://ev-v2.cc.api.here.com/ev/stations.json?prox=" + fmt.Sprint(latitude) + "," + fmt.Sprint(longitude) + ",5000&connectortype=31&apiKey=" + apikey
res, err := http.Get(url)
if err != nil {
log.Fatalln(err)
}
body, err := ioutil.ReadAll(res.Body)
if err != nil {
log.Fatalln(err)
}
fmt.Println(string(body))
}
答案1
得分: 1
EV路线规划需要进行白名单授权。我建议您与您的AE联系,或者与我们所在地区的相关团队联系,我们这里有一个需要填写的联系表格 - https://www.here.com/contact
英文:
EV routing requires whitelisting. I would suggest please get in touch with your AE, or to get in contact with the respective team out of your region we have here a contact form you need to fill - https://www.here.com/contact
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论