Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nukosuke/go-zendesk

Zendesk API client library for Go
https://github.com/nukosuke/go-zendesk

api go golang zendesk

Last synced: 18 days ago
JSON representation

Zendesk API client library for Go

Awesome Lists containing this project

README

        

# go-zendesk

[![Actions Status](https://github.com/nukosuke/go-zendesk/workflows/CI/badge.svg)](https://github.com/nukosuke/go-zendesk/actions)
[![Build status](https://ci.appveyor.com/api/projects/status/ce4p1mswjkdftv6o/branch/master?svg=true)](https://ci.appveyor.com/project/nukosuke/go-zendesk/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/nukosuke/go-zendesk/badge.svg?branch=master)](https://coveralls.io/github/nukosuke/go-zendesk?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/nukosuke/go-zendesk)](https://goreportcard.com/report/github.com/nukosuke/go-zendesk)
[![GoDoc](https://godoc.org/github.com/zenform/go-zendesk?status.svg)](https://pkg.go.dev/github.com/nukosuke/go-zendesk/zendesk)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnukosuke%2Fgo-zendesk.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnukosuke%2Fgo-zendesk?ref=badge_shield)

Zendesk API client library for Go

- [Reference](https://pkg.go.dev/github.com/nukosuke/go-zendesk/zendesk)

## Installation

```shell
$ go get github.com/nukosuke/go-zendesk
```

## Usage

```go
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("[email protected]", "apitoken"))

// Authenticate with agent password
client.SetCredential(zendesk.NewBasicAuthCredential("[email protected]", "password"))

// Create resource
client.CreateGroup(context.Background(), zendesk.Group{
Name: "support team",
})
}
```

## Want to mock API?

go-zendesk has a [mock package](https://pkg.go.dev/github.com/nukosuke/go-zendesk/zendesk/mock) generated by [uber-go/mock](https://github.com/uber-go/mock).
You can simulate the response from Zendesk API with it.

## To regenerate the mock client

`go generate ./...`

## Zendesk OBP(Offset Based Pagination) to CBP(Cursor Based Pagination) migration guide
[CBPMigration](CBPMigration.md)

## Maintainer

- [nukosuke](https://github.com/nukosuke)

## License

MIT License.

See the file [LICENSE](./LICENSE).

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnukosuke%2Fgo-zendesk.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnukosuke%2Fgo-zendesk?ref=badge_large)