Skip to content

sk1tt1sh/AutotaskNET

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autotask PSA

AutotaskNET GitHub License GitHub Release Travis Build Status

Autotask Web Services API .NET Interface

GitHub Last Commit GitHub Issues GitHub Pull Requests

.NET Framework Autotask Web Services

Documentation

Autotask Web Services API Version 1.5 User Guide

Bugs/Features/Contributing

Please open an issue or pull request in GitHub.

Examples

Connect
using AutotaskNET;
using AutotaskNET.Entities;

class Program
{
    private const string @USERNAME = "api.user@domain.com";
    private const string @PASSWORD = "P@ssw0rd";
    static void Main(string[] args)
    {
        ATWSInterface atAPI = new ATWSInterface();
        try
        {
            atAPI.Connect(@USERNAME, @PASSWORD);
        }
        catch (Exception e)
        {
            Console.WriteLine($"Error: {e.Message}");
        }
        if (atAPI.IsConnected)
        {
            //use atAPI here
            
        }
    }
}
Get Account Types
List<PicklistValue> account_types = atAPI.GetPicklistValues(typeof(Account), "AccountType");
Get Customer Accounts
int account_types_customer = account_types.Find(type => type.Label == "Customer").Value;

List<Account> customer_accounts = atAPI.Query(typeof(Account), new List<QueryFilter> {
    new Condition() { FieldName = "AccountType", Operation = "Equals", Value = account_types_customer }
}).OfType<Account>().ToList();
Get Tickets Updated Today
int activity_since = DateTime.Today; //search from the start of today

List<Ticket> tickets_updated_today = atAPI.Query(typeof(Ticket), new List<QueryFilter> {
    new Condition() { FieldName = "LastActivityDate", Operation = "greaterthan", Value = activity_since }
}).OfType<Ticket>().ToList();
Get Tickets Updated Today For Specific Customer
int activity_since = DateTime.Today; //search from the start of today

List<Ticket> tickets_updated_today = atAPI.Query(typeof(Ticket), new List<QueryFilter> {
    new ConditionGroup(ConditionGroupOperation.AND) {
        new Condition() { FieldName = "LastActivityDate", Operation = "greaterthan", Value = activity_since }
        new Condition() { FieldName = "Account", Operation = "equals", Value = customer_accounts.Find(account => account.AccountName == "Customer Name").id }
	}
}).OfType<Ticket>().ToList();

About

Autotask Web Services API .NET Interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%