site logo

Example: Ticket search (C#)

Example: create / update a ticket and a comment  

This script shows how to:

  • connect to your helpdesk API with your access key
  • search tickets
// This codes was contributed by Sean Haddy from
// Start a new ASP.NET Website or web project (or extend a new project). Right click on References and click "Add Web Reference"
// Here you will paste the service url to your Mojo Helpdesk Portal… which will look something like this:
// Hit >Go and press no to any security warnings you may receive.
// Pay attention to the 'Web reference name' on the right, you will use this to hook up the proxy.
// After successful add, build the project to ensure the web reference is built.

// ASP.NET/C# Codebehind:


private const string accessKey = "youraccesskey";

Page_Load or within any event desired:

// replace all instances of com.mojohelpdesk.mojoreference with 'Web reference name' referred to above
com.mojohelpdesk.mojoreference.BackendService proxy = new com.mojohelpdesk.mojoreference.BackendService();

com.mojohelpdesk.mojoreference.TicketSearchParameters searchParams = new;

searchParams.status = "open";
searchParams.created_days = "7";
searchParams.created_days_before_or_after = "after";

com.mojohelpdesk.jensonusa.TicketListResponse responseData = proxy.FindTickets(accessKey, searchParams)

for (int i = 0; i <; i++)
// this will output some general information to asp:Label named output
output.Text += "id: " +[i].id + ", title: " +[i].title + ", status: " +
responseDatckets[i].status + ", created by: " +[i].created_by.full_name + "<br />";


catch (Exception err)
// error handling here