Skip to content

Instantly share code, notes, and snippets.

@joefusaro
Created April 2, 2020 17:07
Show Gist options
  • Save joefusaro/393e16933f72f7e3308fc085daac018f to your computer and use it in GitHub Desktop.
Save joefusaro/393e16933f72f7e3308fc085daac018f to your computer and use it in GitHub Desktop.
from marketorestpython.client import MarketoClient
BATCH_ID = 3274
MUNCHKIN_ID = 'xxx-xxx-xxx'
CLIENT_ID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
CLIENT_SECRET = 'xxxxxxxxxxxxxx'
mc = MarketoClient(MUNCHKIN_ID, CLIENT_ID, CLIENT_SECRET)
failed_leads = mc.execute(method='get_import_failure_file', id=BATCH_ID)
file_name = "import-failure-for-batch-" + str(BATCH_ID) + ".csv"
if failed_leads is not '':
f = open(file_name, mode='w')
f.write(failed_leads)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment