How to check a lead exists or not | Community
Skip to main content
August 12, 2015
Solved

How to check a lead exists or not

  • August 12, 2015
  • 3 replies
  • 4442 views

Hi,

Am developing a windows service in C# .net, to update the Unsubscribe status of each leads in marketo from our database. So for that before updating the status i want to make sure that particular lead exists in Marketo. Can anyone suggest , how can i do that...?

Thanks

Jay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kenny_Elkington

The simplest way to do this is to check with Get Lead By Filter Type. Set you filterType to email, and put up to 300 email values in filterValues.  Be sure included the unsubscribed field in your return fields.

3 replies

August 12, 2015

see developers.marketo.com

Kenny_Elkington
Adobe Employee
Kenny_ElkingtonAdobe EmployeeAccepted solution
Adobe Employee
August 12, 2015

The simplest way to do this is to check with Get Lead By Filter Type. Set you filterType to email, and put up to 300 email values in filterValues.  Be sure included the unsubscribed field in your return fields.

August 13, 2015

Hi Jayanth

I agree with Kenny.

but I come up with an another way.

If you specify "action" parameter "updateonly" at Update leads API, non exist user won't be created.

Of cause this way is not before updating and i don't know which way is efficient.

Create/Update Leads » Marketo Developers

Kenny_Elkington
Adobe Employee
Adobe Employee
August 13, 2015

This can be more efficient in certain cases, but becomes problematic if you are using email as your lookupField and there are potential duplicates.  In the case of a dupe on email address, updateOnly will skip update because of an ambiguous key and will not return the IDs you need to perform subsequent updates.  Retrieving the records first will give you the IDs you need to make unambiguous updates.  Depending on the number of dupes in your system, and whether you're going for maximum speed or minimum API calls your answer will be different.

August 19, 2015

Thanks guys, your solutions are working for me. I got the Leads by Get Lead By Filter Type

And after that am updating the "unsubscribe" status using this method  Create/Update Leads » Marketo Developers

but am getting a message like below

"{\"requestId\":\"6699#14f460e8f8c\",\"result\":[{\"status\":\"skipped\",\"reasons\":[{\"code\":\"1010\",\"message\":\"Partition update not allowed\"}]}],\"success\":true}"

Our Marketo Instance has partions, When i made the request i passed the partitionname as "Default", even if i did not pass the partitionname its giving the same message . Anyone knows whats causing this..? and any idea how to fix this. ?

Thanks is advance