Url Encoding in SAP / PTV Developer
Posted: Mon Apr 28, 2025 1:41 pm
Hi there,
maybe someone from our SAP players can assist with this question which came through some SAP driven partner. He tries to use our PTV Developer Routing API but struggles with some SAP side effect I can't support by myself:
maybe someone from our SAP players can assist with this question which came through some SAP driven partner. He tries to use our PTV Developer Routing API but struggles with some SAP side effect I can't support by myself:
The only thing I can contribute from outside SAP is: both of the following URLs work fine in the browserI have encountered a problem with specifying waypoints, for example:
waypoints=49.12345,8.6789
The issue is the comma used to separate the coordinates. Since these are passed in the URL, they should, in my opinion, be encoded, see also https://www.w3schools.com/tags/ref_urlencode.ASP.
When encoded, it becomes:
waypoints=49.12345%2C8.6789
However, this is not understood by your server and results in an error. If the comma is not encoded, the request works without any issues.
Unfortunately, the SAP system always performs this encoding, and so far, I have not found a way to prevent it.
Is there a possible workaround on your side, or do you have any other tips?
- api.myptv.com/routing/v1/routes?waypoints=49.0133618,8.427&waypoints=48.8923597,8.6718553&apiKey=
- api.myptv.com/routing/v1/routes?waypoints=49.0133618%2C8.427&waypoints=48.8923597%2C8.6718553&apiKey=