freshdesk

package module
v0.0.0-...-ad8a1da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2016 License: MIT Imports: 5 Imported by: 0

README

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.

Documentation

Index

Constants

View Source
const (
	// Email ...
	Email source = 1 + iota
	// Portal ...
	Portal
	// Phone ...
	Phone
	// Forum ...
	Forum
	// Twitter ...
	Twitter
	// Facebook ...
	Facebook
	// Chat ...
	Chat
)
View Source
const (
	// Open ...
	Open status = 2 + iota
	// Pending ...
	Pending
	// Resolved ...
	Resolved
	// Closed ...
	Closed
)
View Source
const (
	// Low ...
	Low priority = 1 + iota
	// Medium ...
	Medium
	// High ...
	High
	// Urgent ...
	Urgent
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NewTicket

type NewTicket struct {
	Ticket *Ticket `json:"helpdesk_ticket"`
	CC     string  `conform:"trim" json:"cc_emails"`
}

NewTicket represents helpdesk ticket request

func (*NewTicket) Create

func (h *NewTicket) Create(r *Request) error

Create posts a new ticket to FreshDesk

type Request

type Request struct {
	Domain string
	API    string
}

Request object for API request

func (*Request) Do

func (r *Request) Do(path string, in, out interface{}) error

Do ...

type Ticket

type Ticket struct {
	Email       string   `conform:"email" json:"email"`
	Name        string   `conform:"name" json:"name"`
	Subject     string   `conform:"trim,title" json:"subject"`
	Description string   `conform:"trim" json:"description"`
	Type        string   `conform:"trim" json:"ticket_type"`
	Status      status   `json:"status"`
	Priority    priority `json:"priority"`
	Source      source   `json:"source"`
}

Ticket represents a single helpdesk ticket

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL