Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

missing live location endpoint #10

Open
asdofindia opened this issue Oct 27, 2018 · 5 comments
Open

missing live location endpoint #10

asdofindia opened this issue Oct 27, 2018 · 5 comments

Comments

@asdofindia
Copy link

The BMTC app allows planning trip by entering source and destination with live location of buses in the route

@Vonter
Copy link
Contributor

Vonter commented Dec 29, 2018

I have made a pull request to add the trip planning at #11

@klpradeepkl
Copy link

is the endpoint available now for live tracking of bus? If so, can you please share with parameters as applicable.

@Vonter
Copy link
Contributor

Vonter commented Mar 10, 2019

is the endpoint available now for live tracking of bus? If so, can you please share with parameters as applicable.

@klpradeepkl I'm not sure if this is the exact endpoint you are looking for, but you can get the live latitude and longitude of a bus like this:

curl -H 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8' -H 'User-Agent:Dalvik/1.6.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83)' -H 'Host:bmtcmob.hostg.in' -H 'Accept-Encoding:gzip' -H 'Content-Length:69' -X POST 'https://bmtcmob.hostg.in/test/api/routemap/details' --data-binary 'routeNO=401&direction=UP&salt_value=abcdefghijklmnopqrstuvwxyz123456&'

You will have to modify the values of 'Content-Length:69', 'routeNO=401', 'direction=UP', 'salt_value=<32characteralphanumeric>'

The actual parameters that the API requires are only the routeNO, direction and a salt value.

The response will be similar to this:

 [                                                                                                                                                                            
        "vehicleno:KA01FA1777",                                                                                                                                                  
        "routeno:401",                                                                                                                                                           
        "vehiclelat:13.017557",                                                                                                                                                  
        "vehiclelng:77.555283",                                                                                                                                                  
        "routeid:35172",                                                                                                                                                         
        "serviceid:1",                                                                                                                                                           
        "nearestlatlng:13.01792884,77.55638747",                                                                                                                                 
        "start_busstopname:Yelahanka Old Town",                                                                                                                                  
        "end_busstopname:Yeshwanthapura TTMC",                                                                                                                                   
        "traveldistance:0.0",                                                                                                                                                    
        "ETA:0",                                                                                                                                                                 
        "FARE:0.0",                                                                                                                                                              
        "routeorder:37"                                                                                                                                                          
    ]        

@klpradeepkl
Copy link

The endpoint you had mentioned is slightly incorrect. The correct one is https://bmtcmob.hostg.in/api/routemap/details.
In the context of live tracking of vehicle, what is the difference between Vehiclelat, Vehiclelng & nearestlatlng.

@Vonter
Copy link
Contributor

Vonter commented Mar 14, 2019

@klpradeepkl As far as I can tell, vehiclelat and vehiclelng are the current position of the bus. nearestlatlng is the coordinates of the nearest bus stop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants