diff --git a/src/ZendeskApi_v2/Requests/HelpCenter/Categories.cs b/src/ZendeskApi_v2/Requests/HelpCenter/Categories.cs index 2c062db6..e1c5d097 100644 --- a/src/ZendeskApi_v2/Requests/HelpCenter/Categories.cs +++ b/src/ZendeskApi_v2/Requests/HelpCenter/Categories.cs @@ -30,6 +30,10 @@ public class Categories : Core, ICategories { private string Locale { get; set; } + private string CategoriesPath => string.IsNullOrEmpty(Locale) + ? "help_center/categories.json" + : $"help_center/{Locale}/categories.json"; + public Categories(string yourZendeskUrl, string user, string password, string apiToken, string locale, string p_OAuthToken) : base(yourZendeskUrl, user, password, apiToken, p_OAuthToken) { @@ -39,7 +43,7 @@ public Categories(string yourZendeskUrl, string user, string password, string ap #if SYNC public GroupCategoryResponse GetCategories() { - return GenericGet("help_center/categories.json"); + return GenericGet(CategoriesPath); } public IndividualCategoryResponse GetCategoryById(long id) @@ -56,7 +60,7 @@ public IndividualCategoryResponse CreateCategory(Category category) var body = new { category }; - return GenericPost("help_center/categories.json", body); + return GenericPost(CategoriesPath, body); } public IndividualCategoryResponse UpdateCategory(Category category) @@ -74,7 +78,7 @@ public bool DeleteCategory(long id) #if ASYNC public async Task GetCategoriesAsync() { - return await GenericGetAsync("help_center/categories.json"); + return await GenericGetAsync(CategoriesPath); } public async Task GetCategoryByIdAsync(long id) @@ -85,7 +89,7 @@ public async Task GetCategoryByIdAsync(long id) public async Task CreateCategoryAsync(Category category) { var body = new { category }; - return await GenericPostAsync(string.Format("help_center/categories.json"), body); + return await GenericPostAsync(CategoriesPath, body); } public async Task UpdateCategoryAsync(Category category)