here-apiheremapshere-routing

Here API getting speed limit got PermissionError


I am getting the permission error after calling the here api. https://route.cit.api.here.com/routing/7.2/calculateroute.json?jsonAttributes=1&waypoint0=51.31854,9.51183&waypoint1=50.11208,8.68342&departure=2019-01-18T10:33:00&routeattributes=sh,lg&legattributes=li&linkattributes=nl,fc&mode=fastest;car;traffic:enabled&app_code=xx&app_id=xx

I used this for APP Id and API Key for app_code but not working. How to fix this?

enter image description here

{
    "_type": "ns2:RoutingServiceErrorType",
    "type": "PermissionError",
    "subtype": "InvalidCredentials",
    "details": "This is not a valid app_id and app_code pair. Please verify that the values are not swapped between the app_id and app_code and the values provisioned by HERE (either by your customer representative or via http://developer.here.com/myapps) were copied correctly into the request.",
    "metaInfo": {
        "timestamp": "2021-12-14T14:26:21Z",
        "mapVersion": "8.30.127.153",
        "moduleVersion": "7.2.202150-9770",
        "interfaceVersion": "2.6.77",
        "availableMapVersion": [
            "8.30.127.153"
        ]
    }
}

Solution

  • The app_code is not the same as the apiKey.

    The app_id/app_code combination is a deprecated authentication method for the HERE location services, that's why you won't find the app_code that matches your app_id in the developer portal anymore.

    Instead, try using apiKey only:

    https://route.ls.hereapi.com/routing/7.2/calculateroute.json?jsonAttributes=1&waypoint0=51.31854,9.51183&waypoint1=50.11208,8.68342&departure=2019-01-18T10:33:00&routeattributes=sh,lg&legattributes=li&linkattributes=nl,fc&mode=fastest;car;traffic:enabled&apiKey=[YOUR_API_KEY]
    

    Notice that the base URL is slightly different when using apiKey.