title: TomTom's API Matrix Routing with Pyton returns Response [400]
body: <p>I'm trying to test TomTom's API Matrix Routing v2 -&gt; Synchronous Matrix (documentation <a href="https://developer.tomtom.com/routing-api/routing-api-documentation-matrix-routing-v2/synchronous-matrix" rel="nofollow noreferrer">here</a>) with Python's requests.</p>
  <p>Here is my code, using their example from the documentation:</p>
  <pre><code>import requests
  
  apiKey      = 'add_api_key_here'
  apiURL      = f'https://api.tomtom.com/routing/matrix/2?key={apiKey}'
  
  post_params = {
                    &quot;origins&quot;: [
                      {
                        &quot;point&quot;: {&quot;latitude&quot;: 36.98844, &quot;longitude&quot;: -121.97482}
                      }
                    ],
                    &quot;destinations&quot;: [
                      {
                        &quot;point&quot;: {&quot;latitude&quot;: 34.13007, &quot;longitude&quot;: -118.228610}
                      }
                    ],
                    &quot;options&quot;: {
                      &quot;traffic&quot;: &quot;historical&quot;,
                      &quot;travelMode&quot;: &quot;truck&quot;,
                      &quot;vehicleCommercial&quot;: True
                    }
                }
  
  headers = {'Content-Type' : 'application/json' }
  resp = requests.post(apiURL, data=post_params, headers=headers)
  </code></pre>
  <p>Why am I getting the <strong>Response [400]</strong> error, saying:</p>
  <pre><code>{&quot;detailedError&quot;:{&quot;code&quot;:&quot;BAD_REQUEST&quot;,&quot;message&quot;:&quot;Bad Request&quot;,&quot;details&quot;:[{&quot;code&quot;:&quot;MALFORMED_BODY&quot;,&quot;message&quot;:&quot;Could not parse matrix request&quot;,&quot;target&quot;:&quot;postBody&quot;}]}}
  </code></pre>
  <p>There is surely something I'm missing, I simply cannot see it. :(</p>