Autofleet / locomotion

An open-source rider/passenger mobile app written in React Native and Node.js that can be customized and modified to support any ride-hailing
MIT License
32 stars 13 forks source link

Unable to generate Price and ETAs #830

Closed nusjose closed 4 months ago

nusjose commented 4 months ago

I get an error with status code 500 when fetching the /estimations API

Screenshot 2024-07-10 at 09 24 33

My cURL

curl --location 'https://api.autofleet.io/api/v1/estimations' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{authToken}}' \
--header 'content-type: application/json' \
--data '
{
  "queries": [
    {
      "rideType": "passenger"
    }
  ],
  "includePrice": true,
  "includeETA": true,
   "stopPoints": [
    {
      "type": "pickup",
      "lat": 43.642566,
      "lng": -79.387057
    },
    {
      "type": "dropoff",
      "lat": 45.507452,
      "lng": -73.587749
    }
  ],
  "demandSourceId": "{{demandSourceId}}",
  "businessModelId": "{{businessModelId}}"
}

Any ideas on how to fix it?

OmerGery commented 4 months ago

Hey again @nusjose

  1. try to follow the same format of request that the locomotion app makes
  2. change base url to client.autofleet.io
  3. please provide with the x-trace-id from the response headers
otaviolbarbosa commented 4 months ago

@OmerGery We got the data after changes, thanks!

OmerGery commented 4 months ago

glad to help @otaviolbarbosa