Response shows various errors based on accuracy

Hi, below is the request we are sending to retrieve toll charges. However, we get different errors depending on what accuracy we send.

Accuracy 10 to 40 = Could not match the trace with the given waypoints
Accuracy 50 = Query string malformed close to position 18
Accuracy 60 = Number of coordinates needs to be at least two

The polyline definitely has more than 2 waypoints.

Could you please help point what is wrong with the request?

“polyline”: “n_coE{}cw[Yk@??gBaD??Mu@??Rq@??d@g@??v@{@??fAq@??\k@??Ps@??@g@??t@G??t@I??XQ??VW??^i@??@U??Rg@??Au@??Wi@??m@A??k@H??mF@??kBE??k@[??Qm@??Y{@??_@s@??WW??UW??uAK??o@O??]H??M@??SfD??O|C??UZ??]K??G]??EY??BN?G??K_@??BK??@Fl@uB??TwA??Bu@??Ja@??NQ??VG??VA??ZH??j@Z??ZB??j@D??b@^??@x@??j@fB??p@d@??|@F??dGY??~@U??p@^??LfA??a@t@??k@r@??q@d@??_AD??y@N??Yz@??_@|@??w@@??u@f@??iApA??Q~@??`@hA??~@|A??Zh@??Vz@??”,
“departureTime” : “2023-06-27T06:10:00+10:00”,
“accuracy”: 60

Hi @vipul.agheda,

We’re not sure whether this was fixed because of the other change we made earlier today. Are you able to double check for us?

The polyline provided appears to be on private or service roads and unmarked paths, which may be why it failed to match previously. It may also be that the polyline wasn’t escaped correctly in JSON format before sending it to the API.

The following payload, with the correct escape characters, is currently working:

  "polyline": "n_coE{}cw[Yk@??gBaD??Mu@??Rq@??d@g@??v@{@??fAq@??\\k@??Ps@??`@g@??t@G??t@I??XQ??VW??^i@??`@U??Rg@??Au@??Wi@??m@A??k@H??mF`@??kBE??k@[??Qm@??Y{@??_@s@??WW??UW??uAK??o@O??]H??M`@??SfD??O|C??UZ??]K??G]??EY??BN?G??K_@??BK??@Fl@uB??TwA??Bu@??Ja@??NQ??VG??VA??ZH??j@Z??ZB??j@D??b@^??`@x@??j@fB??p@d@??|@F??dGY??~@U??p@^??LfA??a@t@??@r@??q@d@??_AD??y@N??Yz@??_@|@??w@`@??u@f@??iApA??Q~@??`@hA??~@|A??Zh@??Vz@??",
  "vehicleClass": "B",
  "accuracy": 60,
  "departureTime": "2023-06-27T06:10:00+10:00"

But note the low confidence as the polyline doesn’t appear to track a known road:

	"match": {
		"confidence": 0.000123,
		"geometry": "j_coEy}cw[AKk@eAOWgAmBMi@Fe@t@cAx@i@v@Wd@m@\\uARe@pAGv@Md@q@`@c@^M",
		"distance": 524.4,
		"duration": 125.7,
		"minChargeInCents": 0,
		"maxChargeInCents": 0,
		"summary": "",
		"tollsCharged": [],
		"isCheapest": true,
		"isShortest": true,
		"isQuickest": true
1 Like

Thank you Jxeeno.
The polyline now works. Seems like the fixes you guys deployed are working.
Yes, we do indeed escape the polylines in JSON before sending to API.

Thanks again.