diff --git a/sageintacctsdk/apis/api_base.py b/sageintacctsdk/apis/api_base.py index 365f52f..6987d25 100644 --- a/sageintacctsdk/apis/api_base.py +++ b/sageintacctsdk/apis/api_base.py @@ -441,8 +441,12 @@ def get_all(self, field: str = None, value: str = None, fields: list = None): } } - paginated_data = self.format_and_send_request(data)['data'][self.__dimension] - complete_data.extend(paginated_data) + response = self.format_and_send_request(data)['data'] + if self.__dimension in response: + paginated_data = response[self.__dimension] + complete_data.extend(paginated_data) + + break return complete_data @@ -584,7 +588,8 @@ def get_by_query(self, fields: List[str] = None, for offset in range(0, count, pagesize): data['query']['offset'] = offset paginated_data = self.format_and_send_request(data)['data'] - complete_data.extend(paginated_data[self.__dimension]) + if self.__dimension in paginated_data: + complete_data.extend(paginated_data[self.__dimension]) filtered_total = int(paginated_data['@totalcount']) if paginated_data['@numremaining'] == '0': break diff --git a/setup.py b/setup.py index b1a808c..1001f12 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='sageintacctsdk', - version='1.23.1', + version='1.23.2', author='Ashwin T', author_email='ashwin.t@fyle.in', description='Python SDK for accessing Sage Intacct APIs',