Skip to content

blue-systems-a-y/go-freshdesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-freshdesk

Go client library for Freshdesk https://developers.freshdesk.com/api/


Overview

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

Build Status License Go Report Card

Table of Contents

Choose the section you are interested in

Prerequisites

To be able to use the client:

  • A valid freshdesk account --> Valid domain & apiKey.

Integration

  • 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)

Usage

Freshdesk Services

  • 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/


Example 1

// Create an asset
c := NewClient(MY_DOMIN, MY_APIKEY)
newAsset := &Asset{
    Name:        "HP Labtop",
    AssetTypeID: 11568,
}
res,err := c.CreateAsset(newAsset)

Example 2

//List all tickets
c := NewClient(MY_DOMIN, MY_APIKEY)
tickets, err := c.ListAllTickets()
for _, ticket := range tickets {
    log.Printf("%+v", ticket)
    }
}

License

About

Go client library for Freshdesk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages