GithubHelp home page GithubHelp logo

isabella232 / freshdesk.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myget/freshdesk.net

0.0 0.0 0.0 56 KB

Freshdesk REST API .NET wrapper

License: Apache License 2.0

C# 95.31% Smalltalk 4.69%

freshdesk.net's Introduction

Freshdesk.NET

Travis NuGet

Freshdesk.Net is a .NET library for freshdesk.com's REST API. It can be used to create contacts, customers and tickets (with attachments). Freshdesk.Net also runs on Mono, so yay!

Installation

Freshdesk.Net is available as a NuGet Package. NuGet package manager the preferred method of integrating Freshdesk.Net into your project.

Visual Studio

Click on Tools -> NuGet Package Manager -> Package Manager Console and enter the following

PM> Install-Package Freshdesk

Xamarin Studio

Click on Project -> Add NuGet Packages then search for "Freshdesk", check it off and click Add Package

Usage

To use Freshdesk.Net you'll need an account on Freshdesk.com. When you create an account you'll get an instance url (typically: http://YOURCOMPANY.freshdesk.com). Each user also has their own API Key. Yours can be found by clicking on your profile image, then Profile Settings and it will be listed on the right hand side of the screen. When you use Freshdesk.Net you'll need your site URL and your API Key. It should be noted that all calls made with this library are made as if they're performed by the user whose API Key is used.

This library makes calls to the Freshdesk REST API. This documentation is helpful debugging your application or determining what values to send for various parameters.

All examples are written as if you've added the following using statement to your file...

using Freshdesk;

Setup

All functions in Freshdesk.Net are made through the instances of the FreshdeskService class. To create an instance of this class you'll need your API Key and your site url.

FreshdeskService freshdeskService = 
		new FreshdeskService(
			"YOUR_API_KEY", 
			new Uri("https://YOURCOMPANY.freshdesk.com"));

Tickets

http://freshdesk.com/api#ticket

Create Ticket

http://freshdesk.com/api#create_ticket

GetTicketResponse ticketResponse = freshdeskService.CreateTicket(new CreateTicketRequest()
{
    TicketInfo = new CreateTicketInfo()
    {
        Email = "[email protected]",
        Subject = "ACME Super Outfit won't fly!!!",
        Description = "I recently purchased an ACME Super Outfit because it was supposed to fly, but it's doesn't work!",
        Priority = 1,
        Status = 2
    }
});
Create Ticket with Attachment

http://freshdesk.com/api#ticket_attachment

var ticketResponse = freshdeskService.CreateTicketWithAttachment(new CreateTicketRequest
{
    TicketInfo = new CreateTicketInfo
    {
        Email = "[email protected]",
        Subject = "Beep Beep",
        Description = "Beep Beep!",
        Priority = 1,
        Status = 2
    }
}, new Collection<Attachment>
{
    new Attachment
    {
        Content = File.OpenRead("beep.txt"),
        FileName = "beep.txt"
    },
    new Attachment
    {
        Content = File.OpenRead("beep.png"),
        FileName = "beep.png"
    }
});

Companies

http://freshdesk.com/api#companies_attributes

Create Customer

http://freshdesk.com/api#create_customer

GetCustomerResponse customerResponse = freshdeskService.CreateCustomer(new CreateCustomerRequest()
{
    Customer = new Customer()
    {
        Name = "ACME Corp.",
        Description = "The ACME Corporation"
    }
});

Users

http://freshdesk.com/api#companies_attributes

Create Customer

http://freshdesk.com/api#create_customer

GetUserResponse userResponse = freshdeskService.CreateUser(new CreateUserRequest()
{
    User = new User()
    {
        Name = "Bugs Bunny",
        Email = "[email protected]"
    }
});

freshdesk.net's People

Contributors

jjb3rd avatar jozsurf avatar justmaier avatar maartenba avatar olsh avatar ubikuity 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.