Dashboard API for Go
The Meraki Dashboard API Golang library provides all current Meraki dashboard API calls to interface with the Cisco Meraki cloud-managed platform.
Go Programming Language >= 1.16
Clone the repository, set environmental variables
go get github.com/core-infra-svcs/dashboard-api-go/client
export MERAKI_DASHBOARD_API_KEY="0123456789"
Client API documentation is available in the /client/docs directory
package main
import "github.com/core-infra-svcs/dashboard-api-go/client"
import "context"
import "fmt"
import "os"
func main() {
configuration := client.NewConfiguration()
configuration.AddDefaultHeader("X-Cisco-Meraki-API-Key", os.Getenv("MERAKI_DASHBOARD_API_KEY"))
apiClient := client.NewAPIClient(configuration)
orgs, _, err := apiClient.ConfigureApi.GetOrganizations(context.Background()).Execute()
if err != nil {
fmt.Println("Meraki API call failed. Details: ", err)
}
for _, org := range orgs {
fmt.Printf("%s\n", *org.Name)
}
}