A Go SDK for the Monta Partner API.
client := monta.NewClient(monta.WithClientIDAndSecret("<ID>", "<SECRET>")
me, err := client.GetMe(ctx)
if err != nil {
panic(err)
}
fmt.Println(me)
response, err := client.ListSites(ctx, &monta.ListSitesRequest{
Page: 1,
PerPage: 10,
})
if err != nil {
panic(err)
}
fmt.Println(response)
response, err := client.ListChargePoints(ctx, &monta.ListChargePointsRequest{
Page: 1,
PerPage: 10,
})
if err != nil {
panic(err)
}
fmt.Println(response)
First you need to build the CLI - to create the monta CLI executable. Assuming you are on root level of the project:
$ cd cmd/monta
$ go build
$ ./monta login --client-id <ID> --client-secret <SECRET>
$ ./monta me
$ ./monta sites
$ ./monta charge-points