Go client library for Freshdesk https://developers.freshdesk.com/api/
go-freshdesk is a client package written in go, used to ease the operations on Freshdesk services, by providing many functions and tools to deal with them, especially the inventory managements, and tickiting system.
Badges
Choose the section you are interested in
To be able to use the client:
- A valid freshdesk account --> Valid
domain
&apiKey
.
- Import the package in your target project
import "github.com/blue-systems-a-y/go-freshdesk"
- Set the credentials environment variables
FS_DOMAIN
FS_KEY //api key
- Create a freshdesk client
fc := freshservice.NewClient(FS_DOMAIN, FS_KEY)
-
Assets Operations
-
ListAssets
--> lists all assets on a certin page. -
ListAllAssets
--> lists all assets on all pages. -
CreateAsset
--> creates an asset in the inventory. -
DeleteAsset
--> Deletes an asset from the inventory.
-
-
Asset Types Operations
-
ListAssetTypes
--> lists all asset types on a certin page. -
ListAllAssetTypes
--> lists all asset types on all pages. -
CreateAssetType
--> creates an asset type in the inventory.
-
-
Locations Operations
-
ListLocations
--> lists all locations on a certin page. -
ListAllLocations
--> lists all locations on all pages. -
CreateLocation
--> creates a new location.
-
-
Products Operations
-
ListProducts
--> lists all locations on a certin page. -
ListAllProducts
--> lists all locations on all pages. -
CreateProduct
--> creates a new location.
-
-
Tickets Operations
-
ListTickets
--> lists all tickets on a certin page. -
ListAllTickets
--> lists all tickets on all pages. -
CreateTickets
--> creates a new ticket.
-
For Further informations about the apis, see Freshdesk APIs docs: https://api.freshservice.com/v2/
// Create an asset
c := NewClient(MY_DOMIN, MY_APIKEY)
newAsset := &Asset{
Name: "HP Labtop",
AssetTypeID: 11568,
}
res,err := c.CreateAsset(newAsset)
//List all tickets
c := NewClient(MY_DOMIN, MY_APIKEY)
tickets, err := c.ListAllTickets()
for _, ticket := range tickets {
log.Printf("%+v", ticket)
}
}