Basic API submitting a ticket to Freshdesk.com
import "github.com/fundedcity/freshdesk"
r := &freshdesk.Request{
Domain: "your-freshdesk-domain",
API: "api-key-here",
}
tk := &freshdesk.NewTicket{
Ticket: &freshdesk.Ticket{
Email: "[email protected]",
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
Ticket struct fields work with the optional conform library.