1

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))
}
Chikku Jacob
  • 2,114
  • 1
  • 18
  • 33
  • 1
    Check the documentation for that API and confirm that's how you're supposed to authenticate to it. Query string is a pretty unusual way to authenticate an API call, it's usually a header. – Adrian Nov 28 '22 at 20:56
  • Try to properly build a query string with all values encoded. Check this https://stackoverflow.com/questions/30652577/go-doing-a-get-request-and-building-the-querystring – wakumaku Nov 28 '22 at 23:34

1 Answers1

1

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