Looking at http://developers.marketo.com/documentation/rest/createupdate-leads/ it says we can set the lookupField in order to have some control over how to identify the leads we are updating. However, when you export all fields, you see that the ID is not available to the REST API.
We tried to get around this by creating a formula field that copies the value of the MarketoID over, but that is also not allowed as the MarketoID is only available as part of the IF statement and not THEN.
We also tried using the token {{lead.MarketoID}} to set the value in the formula field, but that also didn't work.
Has anyone else run into this problem before, and if so, how have you addressed it?
Solved! Go to Solution.
Hi Myokhaylo
According to http://developers.marketo.com/documentation/rest/createupdate-leads/
I think you need lookUpField parameter.
If lookUpField is not specified, email will be used for deduplication.
? The REST lookup field for Lead ID is just "id".
The error I'm getting is
{"requestId":"bd3e#15559d49a99","result":[{"status":"skipped","reasons":[{"code":"1003","message":"Field 'id' not allowed"}]}],"success":true}
What's the full URL and body of the request?
URL: https://642-NLJ-561.mktorest.com/rest/v1/leads.json?access_token=xxx
1).
Request:
{"action": "updateOnly", "input": [{"id": 1000240, "leadScore": 6}]}
Respond:
{"requestId":"bd3e#15559d49a99","result":[{"status":"skipped","reasons":[{"code":"1003","message":"Field 'id' not allowed"}]}],"success":true}
2).
Request:
{"action": "updateOnly", "input": [{"email": "xxx@yyy.com", "leadScore": 6}]}
Respond:
{"requestId":"20b0#15559f4bae0","result":[{"id":1000240,"status":"updated"}],"success":true}
According to https://642-nlj-561.mktorest.com/rest/v1/leads/describe.json?access_token=xxx there is field „Id“ in the block „rest"
https://642-nlj-561.mktorest.com/rest/v1/leads/describe.json{"id":42,"displayName":"Id","dataType":"integer","rest":{"name":"id","readOnly":false},"soap":{"name":"Id","readOnly":false}}
which looks similar analog to leadScore
{"id":143,"displayName":"Lead Score","dataType":"integer","rest":{"name":"leadScore","readOnly":false},"soap":{"name":"LeadScore","readOnly":false}}
what is the problem? what we are doing wrong? is it a bug or feature? it takes so much time to figure out. the examples on the developer page have no update examples for Rest API based on the lead id at all.
Another thing: when i go to Admin > Field Management > Export Field Names then i get Fields.xls downloaded and there is no "id" in the "REST API Name" column, which does not correspond to the lead's fields list under https://642-nlj-561.mktorest.com/rest/v1/leads/describe.json?access_token=xxx
Please Help?!
Well there's the problem. We weren't using lookupField="id" in the request.
It is working now.
Hi Myokhaylo
According to http://developers.marketo.com/documentation/rest/createupdate-leads/
I think you need lookUpField parameter.
If lookUpField is not specified, email will be used for deduplication.
You are right, now it works:
Request:
{"action": "updateOnly", "lookupField": "id", "input": [{"id": 1000240, "leadScore": 8}, {"id": 238, "leadScore": 1}]}
Response:
{"requestId":"1ee#1555eb7af81","result":[{"id":1000240,"status":"updated"},{"id":238,"status":"updated"}],"success":true}
Thanks to all!
Change the action to create or update, not create only. I can't articulate why this is.
Because the ID is system-assigned? Like if you did a MSSQL insert without IDENTITY_INSERT.