Reputation: 181
I am getting INVALID_REQUEST for certain requests while its working for others. For example, the following returns INVALID_REQUEST
I have also tried several other variations like the one below:
This same piece of code is working for some postcodes in the UK but returning INVALID_REQUEST for others. If you search for the postcodes in google maps web interface (EC3N4AB and EC4M8AD), the web interface can easily provide directions.
Wondering what is wrong with my URL? Any help will be appreciated.
Cheers,
Upvotes: 1
Views: 1918
Reputation: 181
Google made departure_time
or arrival_time
mandatory on API requests. This URL works:
http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit&departure_time=1343376768
Thank everyone for their help.
Upvotes: 4
Reputation: 1572
Try to use region parametre:
http://maps.googleapis.com/maps/api/directions/json?origin=EC3N4AB&destination=EC4M8AD&sensor=false&mode=transit®ion=uk
Another reason may be that does not support transit (try with driving, work good ;-) )
Regards
cadetill
Upvotes: 0