Giter Club home page Giter Club logo

freshdeskapidotnet's Introduction

Build Status Quality Gate Status NuGet MyGet

Freshdesk API Client

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)

Usage

This library provides a single client class which can be created in one of several ways:

  1. No existing HttpClient object (suitable for console applications)
using var freshdeskHttpClient = new FreshdeskHttpClient("https://mydomain.freshdesk.com", "APIKEY");
var freshdeskClient = FreshdeskClient.Create(freshdeskHttpClient);

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.

  1. Existing HttpClient object (suitable for asp.net applications or cases where you want more control over the HttpClient)
var freshdeskHttpClient = new FreshdeskHttpClient(myHttpClient);
var freshdeskClient = FreshdeskClient.Create(freshdeskHttpClient);

NOTE: Typically you don't want to dispose the freshdesk client in this case.

  1. Using Microsoft.Extensions.DependencyInjection
using FreshdeskApi.Client.Extensions;

serviceCollection.AddFreshdeskApiClient(options => {
  options.FreshdeskDomain = "https://<mydomain>.freshdesk.com";
  options.FreshdeskDomain = "APIKEY"; 
})

...

container.GetRequiredService<IFreshdeskClient>();
container.GetRequiredService<IFreshdeskTicketClient>();
container.GetRequiredService<IFreshdesk...Client>();

Examples

Get a single ticket, including the company information on the API response

using var freshdeskHttpClient = new FreshdeskHttpClient("https://mydomain.freshdesk.com", "APIKEY");
var freshdeskTicketClient = new FreshdeskTicketClient(freshdeskHttpClient);
var ticket = await freshdeskTicketClient.ViewTicketAsync(
  ticketId: 12345, 
  includes: new TicketIncludes { Company = true }
);

API Coverage

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

Development

The library utilises C#9 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.

freshdeskapidotnet's People

Contributors

bmlenihan avatar davetcode avatar dependabot-preview[bot] avatar dependabot[bot] avatar jeanux avatar keziashirazi98 avatar knippers avatar luan122 avatar pekspro avatar tiberhealth avatar trejjam avatar tschlecht06 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.