Skip to content

nukosuke/go-zendesk

Folders and files

NameName
Last commit message
Last commit date
Feb 6, 2024
Oct 3, 2023
Oct 16, 2023
Mar 5, 2024
Jan 21, 2021
Oct 11, 2023
Jan 18, 2023
Feb 6, 2024
Dec 7, 2022
Mar 7, 2024
Mar 7, 2024

Repository files navigation

go-zendesk

Actions Status Build status Coverage Status Go Report Card GoDoc FOSSA Status

Zendesk API client library for Go

Installation

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

Usage

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",
    })
}

Want to mock API?

go-zendesk has a mock package generated by 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

Maintainer

License

MIT License.

See the file LICENSE.

FOSSA Status