This project is read-only.
Kayako Rest API

The following is an implementation of the REST API supplied with the Kayako Fusion 4.0 Support software. The implementation of the API is relatively complete, though it is missing a few of the API features. The basic structure is very simple to understand and easily extendible. If you extend the core API functions or create any bug fixes feel free to submit them back to the code base.


I should re-iterate that the source code is unsupported and comes as-is. It is not necessarily a finished product but can form the basis for your own projects or give you a head start creating your own library

Examples and Documentation

The API is horrendously is easy to use. That said there are a few examples of using the API in the attached TestApplication which covers most of the implemented use cases. The code is also documented. Feel free to contribute documentation and examples if you create them!

Example Code creating a Ticket

    var service_ = new KayakoService(API_KEY, SECRET_KEY, API_URL);
    //Just get the first ticket so we can use it for creation.
    var ticket = service_.GetTicket(1);
    //Get the first staff memeber.
    var staff = service_.GetStaff(1);
    //Get the first user
    var user = service_.GetUser(1);

    var ticketToken = new TicketCreationToken
	 "New Ticket",
	 "Ticket Contents",

    Ticket newTicket = service_.CreateTicket(ticketToken);

    Console.WriteLine("New Ticket Created:");
    Console.WriteLine("ID: {0}", newTicket.ID);
    Console.WriteLine("Subject: {0}", newTicket.Subject);
    Console.WriteLine("UserID: {0}", newTicket.UserID);

Example Code Adding a Post
    //Just get the first ticket so we can use it for creation.
    Ticket ticket = service_.GetTicket(1);

    //Get the first staff memeber.
    var user = service_.GetUser(1);

    TicketPost post = service_.AddTicketPost(ticket.ID, "API Generated Post", "Contents of API Generated Note", user.ID, null);

    Console.WriteLine("New Ticket Post Created:");
    Console.WriteLine("Contents: {0}", post.Contents);
    Console.WriteLine("Creator: {0}", post.Creator);
    Console.WriteLine("Email: {0}", post.Email);

Last edited May 16, 2011 at 5:42 PM by IanSaunders, version 10


No comments yet.