.NET C# SysAid Api (Basic Ticket Submit with code)

 
Author
Message
SysAider
3
 
So, after spending all my time doing this from scratch I figured I'd save everyone else a few hours of google/forum searching.
This is the quick way to get a basic C# SysAidApi going to submit Tickets from your own webpage (references at the bottom in case you also wish to load them into your UI).
It's very easy to do however, finding the documentation to do this is a time sink and is what makes this harder than it should be.

First, get your wsdl from the SysAid software (Settings > Integration > SysAid API). If you aren't the admin you'll have to go find your admin and get the wsdl link from them.

After you've done that, using VS 2013 (steps will be similar for older versions), make a new blank C# project that outputs a class library
-do not mark options for web api in the project template window, you want a blank/empty project
-I tried adding the service reference to an existing project but, I ran into issues with my code not being able to find the references/namespace to the API (very odd, let me know if you find the cause)

After you've made the empty project, in Solution Explorer right click the project -> Add -> Service Reference...

Under "Address:", enter your wsdl link and click go.

The service will show up, click the expansion arrow and select the SysaidApiService and give it a namespace (I called mine SysAidApi)
Click OK. Build the project once to generate your .dll and move to your actual project where you are doing ticket loading/submitting.

In your project doing all the work (let us call it "TicketSubmit" for this example), add the .dll from your SysAidApi project as a reference.
Open your web.config in project TicketSubmit and, add this block (found in your SysAidApi web.config) inside the <configuration> tag:


This allows your project making the call to the SysAidApi to see the service, save the web.config and go to your C# code behind. If you wish to point your project at a test database just update the <endpoint address=""> to the url for your local test db. (Someone else worked with sysaid to get the test db setup for me so I'm not sure of the details for that)

Add your using statement:


Now, the basic code to submit a ticket:


I hope this saves someone time in the future.

References for further use:
//full custom load/save integration in VB (far more useful than the API guide, also has the VB source code use as a .zip download)
https://www.sysaid.com/Sysforums/posts/list/10218.page

//Basic C# setup, provides how to load a ticket
https://www.sysaid.com/Sysforums/posts/list/10105.page







This message was edited 3 times. Last update was at Apr. 09, 2014 08:06 PM

SysAider
1
 
Hi
about:

How can you add a second entry key and value?

Regards, Danny