Zendesk API client library for Go
$ go get github.com/nukosuke/go-zendesk
package main
import (
"context"
"github.com/nukosuke/go-zendesk/zendesk"
)
func main() {
// You can set custom *http.Client here
client, _ := zendesk.NewClient(nil)
// example.zendesk.com
client.SetSubdomain("example")
// Authenticate with API token
client.SetCredential(zendesk.NewAPITokenCredential("john.doe@example.com", "apitoken"))
// Authenticate with agent password
client.SetCredential(zendesk.NewBasicAuthCredential("john.doe@example.com", "password"))
// Create resource
client.CreateGroup(context.Background(), zendesk.Group{
Name: "support team",
})
}
go-zendesk has a mock package generated by uber-go/mock. You can simulate the response from Zendesk API with it.
go generate ./...
MIT License.
See the file LICENSE.