コード例 #1
0
        /// <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;
        }
コード例 #2
0
ファイル: ZendeskApi.cs プロジェクト: salah9/ZendeskApi_v2
        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;
        }