/// <summary> /// Get all existing MyLibrary folders /// </summary> /// <param name="sortBy">Specifies how the list of folders is sorted</param> /// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param> /// <param name="pag">Pagination object.</param> /// <returns>Returns a collection of MyLibraryFolder objects.</returns> public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy, int? limit, Pagination pag) { string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.MyLibraryFolders, GetQueryParameters(new object[] { "sort_by", sortBy, "limit", limit })) : pag.GetNextUrl(); RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey); try { var results = response.Get<ResultSet<MyLibraryFolder>>(); return results; } catch (Exception ex) { throw new CtctException(ex.Message, ex); } }
/// <summary> /// Get all existing MyLibrary folders /// </summary> /// <param name="accessToken">Access token.</param> /// <param name="apiKey">The API key for the application</param> /// <param name="sortBy">Specifies how the list of folders is sorted</param> /// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param> /// <param name="pag">Pagination object.</param> /// <returns>Returns a collection of MyLibraryFolder objects.</returns> public ResultSet<MyLibraryFolder> GetLibraryFolders(string accessToken, string apiKey, FoldersSortBy? sortBy, int? limit, Pagination pag) { ResultSet<MyLibraryFolder> results = null; string url = (pag == null) ? String.Concat(Config.Endpoints.BaseUrl, Config.Endpoints.MyLibraryFolders, GetQueryParameters(new object[] { "sort_by", sortBy, "limit", limit})) : pag.GetNextUrl(); CUrlResponse response = RestClient.Get(url, accessToken, apiKey); if (response.IsError) { throw new CtctException(response.GetErrorMessage()); } if (response.HasData) { results = response.Get<ResultSet<MyLibraryFolder>>(); } return results; }
/// <summary> /// Get all existing MyLibrary folders /// </summary> /// <param name="sortBy">Specifies how the list of folders is sorted</param> /// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param> /// <param name="pag">Pagination object.</param> /// <returns>Returns a collection of MyLibraryFolder objects.</returns> public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy, int? limit, Pagination pag) { return MyLibraryService.GetLibraryFolders(this.AccessToken, this.APIKey, sortBy, limit, pag); }
/// <summary> /// Get all existing MyLibrary folders /// </summary> /// <param name="sortBy">Specifies how the list of folders is sorted</param> /// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param> /// <returns>Returns a collection of MyLibraryFolder objects.</returns> public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy, int? limit) { return this.GetLibraryFolders(sortBy, limit, null); }
/// <summary> /// Get all existing MyLibrary folders /// </summary> /// <param name="sortBy">Specifies how the list of folders is sorted</param> /// <returns>Returns a collection of MyLibraryFolder objects.</returns> public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy) { return this.GetLibraryFolders(sortBy, null, null); }