Python interface to marketo REST api
Detailed Doc - http://developers.marketo.com/documentation/rest/
pip install pythonmarketo
from pythonmarketo.client import MarketoClient
mc = MarketoClient(host = <Host>,
client_id = <Client_Id>,
client_secret = <Client_Secret>)#values could be either "v1 v2 v3" or [v1,v2,v3]
mc.execute(method = 'get_leads', filtr = 'email', values = '[email protected]', fields=['email','firstName','lastName','company','postalCode'])mc.execute(method = 'get_leads_by_listId', listId = '676', fields=['email','firstName','lastName','company','postalCode'])mc.execute(method = 'get_activity_types')#sinceDatetime format:
#2014-10-06T13:22:17-08:00
#2014-10-06T13:22-07:00
#2014-10-06
mc.execute(method = 'get_paging_token', sinceDatetime = '2014-10-06')#activityTypeIds could be either "v1 v2 v3" or [v1,v2,v3]
mc.execute(method = 'get_lead_activity', activityTypeIds = ['23','22'], sinceDatetime = '2014-10-06', batchSize = None, listId = None)mc.execute(method = 'create_lead', lookupField = 'email', lookupValue = '[email protected]', values = {'firstName':'Test1', 'lastName':'Test2'})mc.execute(method = 'update_lead', lookupField = 'email', lookupValue = '[email protected]', values = {'firstName':'Test1', 'lastName':'Test2'})Remaining API