ajax - Creating Leads in Marketo using REST API -


i trying create leads in marketo using /rest/v1/leads.json endpoint. process working, not save 2 custom values lead - name, email, phone etc getting saved new lead. form not marketo generated form, , ran across this...

"the munchkin admin page allows enable munchkin api. munchkin api, can integrate third party software marketo , web site; custom tracking of events such multimedia playback; , use own, non-marketo-generated forms cookie users and/or create new leads in marketo database."

if using non-marketo-generated form - have use munchkin api? noticed there wasn't in 'field mapping' area of admin these custom fields - i'm not sure if matters when creating lead or not thru api.

here call looks like: $.ajax({ type: 'post', url: 'https://xxx-xxx-xxxx.mktorest.com/rest/v1/leads.json? access_token=tokenhere', data: '{ "action":"createonly","lookupfield":"email","partitionname":"name","input":[ {"firstname":'+$( "#first_name" ).val()+',"lastname":'+$( "#last_name" ).val()+',"email":'+$( "#email" ).val()+',"phone":'+$( "#phone" ).val()+',"company":'+$( "#company" ).val()+',"country":'+$( "#00nc00000050dlb" ).val()+',"industry":'+$( "#industry" ).val()+',"googleclickid":'+gclid+',"googlevisitorid":'+accountid+'}]}', datatype : 'jsonp', crossdomain:true, success: function(data) { }, contenttype: "application/json", datatype: 'json' });

(gclid & accountid have values)

the fieldname xls looks this:

googleclickid googleclickid google click id

googlevisitorid googlevisitorid google visitor id

you should able create leads including custom fields using rest api. no need use munchkin api. make sure include correct field names: in admin > field management can download xls field names rest api. there system fields cannot modified using rest api.

edit: based on additional info provided, fix following:

  • the field names should start lower case character, see xls
  • remove lookupfield , partitionname

to test, recommend using interactive tool curl or postman before updating script. allows see error messages , adjust code accordingly.

(if solves issue, please plus answer; i'm trying 50 reputation can comment :-)


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -