Skip to content
Maciej Mionskowski edited this page Oct 22, 2016 · 3 revisions

Vehicles service lets you manage vehicles associated with your route4me account.

Creating Service

import (
	"github.com/route4me/route4me-go-sdk"
	"github.com/route4me/route4me-go-sdk/vehicles"
)

func main() {
	client := route4me.NewClient("your-api-key")
	service := &vehicles.Service{Client: client}
}

Endpoints

Getting Vehicles

Get vehicles belonging to the Route4Me’s account.

import (
	"github.com/route4me/route4me-go-sdk"
	"github.com/route4me/route4me-go-sdk/vehicles"
)

func main() {
	client := route4me.NewClient("your-api-key")
	service := &vehicles.Service{Client: client}
	vehicles, err := service.GetVehicles()
	if err != nil {
		t.Error(err)
	}
	//do something with vehicles, it's []Vehicle
}