Autotask Web Services API .NET Interface
Autotask Web Services API Version 1.5 User Guide
Please open an issue or pull request in GitHub.
IRC Freenode #AutotaskNET
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)
{
try
{
ATWSInterface atAPI = new ATWSInterface(@USERNAME, @PASSWORD);
}
catch (Exception e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
List<PicklistValue> account_types = atAPI.GetPicklistValues(typeof(Account), "AccountType");
int account_types_customer = account_types.Find(type => type.Label == "Customer").Value;
List<Account> customer_accounts = atAPI.Query(typeof(Account), new List<QueryFilter> {
new QueryFilter() { FieldName = "AccountType", Operation = "Equals", Value = account_types_customer }
}).OfType<Account>().ToList();
int activity_since = DateTime.Today; //search from the start of today
List<Ticket> tickets_updated_today = atAPI.Query(typeof(Ticket), new List<QueryFilter> {
new QueryFilter() { FieldName = "LastActivityDate", Operation = "greaterthan", Value = activity_since }
}).OfType<Ticket>().ToList();
int activity_since = DateTime.Today; //search from the start of today
List<Ticket> tickets_updated_today = atAPI.Query(typeof(Ticket), new List<QueryFilter> {
new QueryFilter() { FieldName = "LastActivityDate", Operation = "greaterthan", Value = activity_since }
new QueryFilter() { FieldName = "Account", Operation = "equals", Value = customer_accounts.Find(account => account.AccountName == "Customer Name").id }
}).OfType<Ticket>().ToList();