Update leads via API using ID? | Community
Skip to main content
Andy_Varshneya1
New Participant
June 17, 2016
Solved

Update leads via API using ID?

  • June 17, 2016
  • 1 reply
  • 7235 views

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?

Best answer by

URL: 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?!


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.

1 reply

SanfordWhiteman
New Participant
June 17, 2016

? The REST lookup field for Lead ID is just "id".

Andy_Varshneya1
New Participant
June 17, 2016

The error I'm getting is

{"requestId":"bd3e#15559d49a99","result":[{"status":"skipped","reasons":[{"code":"1003","message":"Field 'id' not allowed"}]}],"success":true}

SanfordWhiteman
New Participant
June 17, 2016

What's the full URL and body of the request?