HERE Toll Cost and Distance API今日调用异常,请求协助排查
Hey there, let's walk through the most likely reasons your API request stopped working today after working fine yesterday, and how to check each one:
1. Verify API Credentials (app_id & app_code)
Even if they worked yesterday, it's worth ruling out credential issues first:
- Double-check that your
{{API_ID}}and{{API_CODE}}haven't expired. HERE credentials can have expiration dates, or might be revoked if there's an issue with your account. - Log into your HERE Developer Portal to confirm the credentials are still active and have access to the Toll Cost & Distance API.
2. Check for Incomplete Request Parameters
Your provided URL is truncated after waypoint0=38.8860434,-76.999525&w... — a valid route calculation request requires at least two waypoints (start and end). If you're missing waypoint1 or it's formatted incorrectly, that would cause an immediate failure.
- Ensure your full request includes both
waypoint0(origin) andwaypoint1(destination) in the correctlatitude,longitudeformat.
3. Validate Parameter Formats & Values
Even if parameters worked before, subtle changes or API updates could break things:
- Cross-reference each parameter against the official HERE API requirements:
tollVehicleType=3,trailerType=2,emissionType=5: Confirm these values match the allowed options for your region and vehicle type.- Mixed units: You're using
12.0t(metric) for vehicle weight and20000lbs(imperial) for limited weight. While the API might support this, double-check if there's a requirement to use consistent units for weight-related parameters. height=144in&trailerHeight=144in: Ensure these values are within the acceptable range for the regions you're routing through.
4. Check for Temporary Service Issues
Sometimes the problem isn't on your end — HERE's services might have temporary outages or maintenance.
- Check the HERE Developer Status page (if available) to see if there's a reported issue with the Toll Cost & Distance API.
5. Inspect the Exact Error Response
The most helpful step is to look at the full error message/response code the API is returning. For example:
- A
401 Unauthorizedpoints directly to credential issues. - A
400 Bad Requestmeans one or more parameters are invalid or missing. - A
500 Internal Server Errorcould be a temporary problem on HERE's infrastructure.
If you can share the exact error details, we can narrow this down even further!
内容的提问来源于stack exchange,提问作者anupamb

