Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
/ freshdesk Public archive
forked from kmanley/freshdesk

Basic Freskdesk.com ticket creation API (Go, golang)

License

Notifications You must be signed in to change notification settings

smallpdf/freshdesk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freshdesk API (Go, golang)

Basic API submitting a ticket to Freshdesk.com

How to use

import (
	"fmt"
	"os"

	"github.com/leebenson/conform"
	"github.com/smallpdf/freshdesk"
)

func main() {
	client, err := freshdesk.NewClient("your-domain", "your-api-key")
	if err != nil {
		fmt.Printf("Could not create client: %s\n", err)
		os.Exit(1)
	}

	ticket := &Ticket{
		Email:       "[email protected]",
		Name:        "your name",
		Subject:     "this is a test",
		Type:        freshdesk.Question,
		Description: "the content of the ticket would go here",
		Status:      freshdesk.Open,
		Priority:    freshdesk.Medium,
		Source:      freshdesk.Portal,
	}

	// optionally check the ticket with conform
	conform.Strings(ticket)

	if _, err := client.CreateTicket(ticket); err != nil {
		fmt.Printf("failed to create ticket: %s", err)
		os.Exit(1)
	}
}

Conform library compatibility

Ticket struct fields work with the optional conform library.

About

Basic Freskdesk.com ticket creation API (Go, golang)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%