Messtone Devices Embedding a Vehicle’s last known location by geograhic coordinates=”/import (“context”smartcar “github.com/smartcar/go-sdk”);//Create a Smartcar client var smartcarClient=Smartcar.NewClient( );//Get all vehicles associated with this access token car vehicleIDs,resErr=smartcarClient.GetVehicleID(context.TODO( ),&smartcar.VehicleIDsParams{Access: “<access-token>”},);//Construct a new vehicle instance using the first vehicle’s id var vehicle=smartcarClient.NewVehicle(&smartcar.VehicleParams{ID:vehicleIDs.VehicleIDs[0],”AccessToken: “<access-token>”});//Fetch the vehicle”s location var fuel, resErr=vehicle.GetLocation(context.TODO( );//Example http response from smartcar{“latitude”:37.4292,”longitude”: 122.1381} GET Location GET https://api.smartcar.com/v2.0/vehicle/{id}/

Leave a comment