/// <summary> /// Constructor that takes 3 params. /// </summary> /// <param name="yourZendeskUrl">Will be formated to "https://yoursite.zendesk.com/api/v2"</param> /// <param name="user"></param> /// <param name="password">LEAVE BLANK IF USING TOKEN</param> /// <param name="apiToken">Optional Param which is used if specified instead of the password</param> public ZendeskApi(string yourZendeskUrl, string user, string password = "", string apiToken = "") { var formattedUrl = GetFormattedZendeskUrl(yourZendeskUrl).AbsoluteUri; Tickets = new Tickets(formattedUrl, user, password, apiToken); Attachments = new Attachments(formattedUrl, user, password, apiToken); Views = new Views(formattedUrl, user, password, apiToken); Users = new Users(formattedUrl, user, password, apiToken); Requests = new Requests.Requests(formattedUrl, user, password, apiToken); Groups = new Groups(formattedUrl, user, password, apiToken); CustomAgentRoles = new CustomAgentRoles(formattedUrl, user, password, apiToken); Organizations = new Organizations(formattedUrl, user, password, apiToken); Search = new Search(formattedUrl, user, password, apiToken); Tags = new Tags(formattedUrl, user, password, apiToken); Forums = new Forums(formattedUrl, user, password, apiToken); Categories = new Categories(formattedUrl, user, password, apiToken); Topics = new Topics(formattedUrl, user, password, apiToken); AccountsAndActivity = new AccountsAndActivity(formattedUrl, user, password, apiToken); JobStatuses = new JobStatuses(formattedUrl, user, password, apiToken); Locales = new Locales(formattedUrl, user, password, apiToken); Macros = new Macros(formattedUrl, user, password, apiToken); SatisfactionRatings = new SatisfactionRatings(formattedUrl, user, password, apiToken); SharingAgreements = new SharingAgreements(formattedUrl, user, password, apiToken); Triggers = new Triggers(formattedUrl, user, password, apiToken); ZendeskUrl = formattedUrl; }
public ZendeskApi(string yourZendeskUrl, string user, string password) { Tickets = new Tickets(yourZendeskUrl, user, password); Attachments = new Attachments(yourZendeskUrl, user, password); Views = new Views(yourZendeskUrl, user, password); Users = new Users(yourZendeskUrl, user, password); Requests = new Requests.Requests(yourZendeskUrl, user, password); Groups = new Groups(yourZendeskUrl, user, password); CustomAgentRoles = new CustomAgentRoles(yourZendeskUrl, user, password); Organizations = new Organizations(yourZendeskUrl, user, password); Search = new Search(yourZendeskUrl, user, password); Tags = new Tags(yourZendeskUrl, user, password); Forums = new Forums(yourZendeskUrl, user, password); Categories = new Categories(yourZendeskUrl, user, password); Topics = new Topics(yourZendeskUrl, user, password); AccountsAndActivity = new AccountsAndActivity(yourZendeskUrl, user, password); JobStatuses = new JobStatuses(yourZendeskUrl, user, password); Locales = new Locales(yourZendeskUrl, user, password); Macros = new Macros(yourZendeskUrl, user, password); SatisfactionRatings = new SatisfactionRatings(yourZendeskUrl, user, password); SharingAgreements = new SharingAgreements(yourZendeskUrl, user, password); Triggers = new Triggers(yourZendeskUrl, user, password); ZendeskUrl = yourZendeskUrl; }
/// <summary> /// Constructor that takes 6 params. /// </summary> /// <param name="yourZendeskUrl">Will be formated to "https://yoursite.zendesk.com/api/v2"</param> /// <param name="user">Email adress of the user</param> /// <param name="password">LEAVE BLANK IF USING TOKEN</param> /// <param name="apiToken">Used if specified instead of the password</param> /// <param name="locale">Locale to use for Help Center requests. Defaults to "en-us" if no value is provided.</param> public ZendeskApi(string yourZendeskUrl, string user, string password, string apiToken, string locale, string p_OAuthToken) { var formattedUrl = GetFormattedZendeskUrl(yourZendeskUrl).AbsoluteUri; Tickets = new Tickets(formattedUrl, user, password, apiToken, p_OAuthToken); Attachments = new Attachments(formattedUrl, user, password, apiToken, p_OAuthToken); Brands = new Brands(formattedUrl, user, password, apiToken, p_OAuthToken); Views = new Views(formattedUrl, user, password, apiToken, p_OAuthToken); Users = new Users(formattedUrl, user, password, apiToken, p_OAuthToken); Requests = new Requests.Requests(formattedUrl, user, password, apiToken, p_OAuthToken); Groups = new Groups(formattedUrl, user, password, apiToken, p_OAuthToken); CustomAgentRoles = new CustomAgentRoles(formattedUrl, user, password, apiToken, p_OAuthToken); Organizations = new Organizations(formattedUrl, user, password, apiToken, p_OAuthToken); Search = new Search(formattedUrl, user, password, apiToken, p_OAuthToken); Tags = new Tags(formattedUrl, user, password, apiToken, p_OAuthToken); AccountsAndActivity = new AccountsAndActivity(formattedUrl, user, password, apiToken, p_OAuthToken); JobStatuses = new JobStatuses(formattedUrl, user, password, apiToken, p_OAuthToken); Locales = new Locales(formattedUrl, user, password, apiToken, p_OAuthToken); Macros = new Macros(formattedUrl, user, password, apiToken, p_OAuthToken); SatisfactionRatings = new SatisfactionRatings(formattedUrl, user, password, apiToken, p_OAuthToken); SharingAgreements = new SharingAgreements(formattedUrl, user, password, apiToken, p_OAuthToken); Triggers = new Triggers(formattedUrl, user, password, apiToken, p_OAuthToken); HelpCenter = new HelpCenterApi(formattedUrl, user, password, apiToken, locale, p_OAuthToken); Voice = new Voice(formattedUrl, user, password, apiToken, p_OAuthToken); Schedules = new Schedules(formattedUrl, user, password, apiToken, p_OAuthToken); Targets = new Targets(formattedUrl, user, password, apiToken, p_OAuthToken); Automations = new Automations(formattedUrl, user, password, apiToken, p_OAuthToken); ZendeskUrl = formattedUrl; }