Building leads in Marketo using the REST API

I am trying to generate leads in Marketo using the / rest / v 1 / leads.json endpoint. The process works, but will not save 2 custom values ​​for the manual, but name, email, phone, etc. Everything will be saved for the new leadership. The form is not a Marketo generated form and I ran into this ...

"The Munchkin admin page also allows you to enable the Munchkin API. Thanks to the Munchkin API, you can integrate third-party software with Marketo and your website, individually track events such as media playback, and use your own non-Marketo-generated forms to cookie users and / or creating new leads in the Marketo database. "

If I use a form other than Marketo do I need to use the Munchkin API? I also noticed that there isn't a lot in the admin "field mapping" area for these custom fields, but I'm not sure if this is important when creating a tutorial or not through the API.

This is what the 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 and accountId are relevant)

The XLS field name looks like this:

googleclickid googleclickid Google click id

googleVisitorID googleVisitorID Google Visitor ID

+3


source to share


1 answer


You should be able to create Leads including all custom fields using the REST API. No need to use the Munchkin API. Make sure you provide the correct field names: in Admin> Field Management you can load XLS with field names for REST API. There are also some system fields that cannot be changed using the REST API.

EDIT: Based on the additional information you provided, please correct the following:

  • Field names must start with a lowercase character, see XLS
  • remove lookupField and partitionName


To check, I would recommend using an interactive tool like cURL or Postman before updating your script. This allows you to see error messages and adjust your code accordingly.

(If that solves your problem please plus an answer, I'm trying to get 50 rep so I can comment :-)

+5


source







All Articles