Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 857 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 857 Bytes

Freshdesk API (Go, golang)

Basic API submitting a ticket to Freshdesk.com

How to use

import "github.com/fundedcity/freshdesk"

r := &freshdesk.Request{
	Domain: "your-freshdesk-domain",
	API:    "api-key-here",
}

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

conform.Strings(tk.Ticket) // <-- optionally use "conform" library

tk.Create(r) // <-- returns error || nil

Conform library compatibility

Ticket struct fields work with the optional conform library.