Skip to content

Commit

Permalink
v0.5.18 fixed bug in getting the bulk extract jobs list: now it gets …
Browse files Browse the repository at this point in the history
…all jobs instead of max 300.
  • Loading branch information
jepcastelein committed Apr 25, 2022
1 parent 292fcda commit 9291965
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions marketorestpython/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5380,9 +5380,20 @@ def _get_export_jobs_list(self, entity, object_name=None):
args = {
'access_token': self.token
}
result = self._api_call(
'get', self.host + '/bulk/v1/{}/export.json'.format(entity), args)
return result['result']
result_list = []
while True:
self.authenticate()
# for long-running processes, this updates the access token
args['access_token'] = self.token
result = self._api_call(
'get', self.host + '/bulk/v1/{}/export.json'.format(entity), args)
if result is None:
raise Exception("Empty Response")
result_list.extend(result['result'])
if 'nextPageToken' not in result:
break
args['nextPageToken'] = result['nextPageToken']
return result_list

def _create_bulk_export_job(self, entity, fields=None, filters=None, format='CSV', columnHeaderNames=None,
object_name=None):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setup(
name='marketorestpython',
version= '0.5.17',
version= '0.5.18',
url='https://github.com/jepcastelein/marketo-rest-python',
author='Jep Castelein',
author_email='[email protected]',
Expand Down

0 comments on commit 9291965

Please sign in to comment.