This is a dotnet standard library providing a thin wrapper around the Freshdesk API as described here: https://developers.freshdesk.com/api.
At present this library requires .NET Standard 2.1 (for IAsyncEnumerable), if I get interest then I'll build a version of the library which doesn't make use of that feature and is therefore available in .NET Standard 2.0 (or possibly lower)
This library provides a single client class which can be created in one of two ways:
- No existing HttpClient object (suitable for console applications)
using var freshdeskClient = new FreshdeskClient("https://mydomain.freshdesk.com", "APIKEY");
NOTE: Disposing the freshdeskClient will dispose the HttpClient object, as per https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ you need to be careful when disposing HttpClient objects. Broadly speaking, don't make and dispose lots of FreshdeskClient objects using this model.
- Existing HttpClient object (suitable for asp.net applications or cases where you want more control over the HttpClient)
var freshdeskClient = new FreshdeskClient(myHttpClient);
NOTE: Typically you don't want to dispose the freshdesk client in this case.
Get a single ticket, including the company information on the API response
using var freshdeskClient = new FreshdeskClient("https://mydomain.freshdesk.com", "APIKEY");
var ticket = await freshdeskClient.Tickets.ViewTicketAsync(
ticketId: 12345,
includes: new TicketIncludes { Company = true }
);
Not all of the Freshdesk API is covered, this table illustrates the current status of coverage by this library. Pull requests to add additional features are welcome.
API Area | Coverage |
---|---|
Tickets | ✔️ |
Ticket Fields | ✔️ |
Conversations | ✔️ |
Contacts | ✔️ |
Agents | ✔️ |
Skills | ❌ |
Roles | ❌ |
Groups | ✔️ |
Companies | ✔️ |
Canned Response Folders | ❌ |
Discussions | ❌ |
Solutions | ✔️ |
Surveys | ❌ |
Satisfaction Ratings | ❌ |
Field Service Management | ❌ |
Time Entries | ❌ |
Email Configs | ❌ |
Email Mailboxes | ❌ |
Products | ❌ |
Business Hours | ❌ |
Scenario Automations | ❌ |
SLA Policies | ❌ |
Settings | ❌ |
The library utilises C#8 features and therefore VS2019 or a suitable text editor are required for making changes.
Please feel free to send pull requests or raise Github issues.