0

I am trying to request TPEG data with the HERE API. I made it as far as receiving a BEAR token and request the URL and key. The next step is to send a HTTP Post request to the received URL with an aes encrypted body.

Unfortunately I always reveice the error "missing query parameter v". Even with an empty body I receive this error.

What is it about? Do I need to complete the received URL somehow? I am using Postman for all the steps needed. What authorization do I need to set for this last request?

Thanks in advance!

Yesyoor
  • 157
  • 1
  • 18
  • Can you link to the API endpoint documentation you're using? – Michel Sep 16 '21 at 14:13
  • sure, see my posted solution. Now I am having trouble encypting the body. The received key is too long for aes128 and would work with aes256. Another question is the format. Should the gzipped xml result in hex or base64 strings? Does the 32 bit int little endian be binary? The Zeros to pad the length should be counted as each char 1 byte or 8 zeros to make up one byte? Thanks in advance – Yesyoor Sep 17 '21 at 08:46

1 Answers1

0

Solution

I figured out that the URL returned in the initsession response is wrong. It looked like this:

https://tpeg.traffic.cit.api.here.com/tpeg/1.0/getmessages?app_id=(yourappid)&v=8&cfg=VOrWft8kgH5SutyP1-ouu2sJnnVOCP8CQSffTHSGyROO0BZeCmQQMk7a1rIM.CqI7hSArRZeW8oJ4xdyeoZ2EWJLnoXHIFOl.BULbBnZmpHhqMZXpJGPILKSolknOi6oDmPucdM8mfTddQRopjUKFlbutXIk9UWO.4KKCUG5xmsXpr4RAEXjW4J4pPn6Ug.FBImacwM2BOT6AYlDUx1.F6aTvn36IF3ERr-ccPndIUZklFdWIVmLEdKD1B3rrpf5

The app_id=... part needs to be replaced as well as the & amp; it should look like this:

https://tpeg.traffic.cit.api.here.com/tpeg/1.0/getmessages?v=8&cfg=VOrWft8kgH5SutyP1-ouu2sJnnVOCP8CQSffTHSGyROO0BZeCmQQMk7a1rIM.CqI7hSArRZeW8oJ4xdyeoZ2EWJLnoXHIFOl.BULbBnZmpHhqMZXpJGPILKSolknOi6oDmPucdM8mfTddQRopjUKFlbutXIk9UWO.4KKCUG5xmsXpr4RAEXjW4J4pPn6Ug.FBImacwM2BOT6AYlDUx1.F6aTvn36IF3ERr-ccPndIUZklFdWIVmLEdKD1B3rrpf5

Now I struggle with the encryption of the body, the returned key is too long for AES128 and I don't know if the final body should be in plain text format, hex or base64. Also do I need to place the little endian 32 bit integer in binary format? How about the zeros to fill up the string to be divisible by 16, does one zero count as one byte, or do I need to stick with the binary format (8 zeros = one byte)?

Yesyoor
  • 157
  • 1
  • 18