SOLVED

REST API Method: search leads with field that contains a specific string ?

Go to solution
Anonymous
Not applicable

REST API Method: search leads with field that contains a specific string ?

Hello,

I created a custom field (OtherEmails__c) which contains all the potential emails that a lead can have (besides its email field). Its format is: "email1@example.com; email2@example.com; email3@example.com". I'd like to get with the REST API method "Get Multiple Leads by Filter Type" all the leads that uses "email1@example.com" (either its default email field or its custom OtherEmails__c field).

First of all, I don't find to do this in only one request, as the method only supports one filterType (not both email and OtherEmails__c at the same time). So I must send a first request on email and if I don't find any result I send a second one on OtherEmails__c. This is too bad but it works.

My real problem is: for my second request, I don't have the full value of OtherEmails__c but only a part of it (for instance "email1@example.com; email2@example.com; email3@example.com" must match if i'm looking for "email1@example.com").

Finally, my questions are: How can I use the REST API method "Get Multiple Leads by Filter Type" to search leads whose filterType field contains one of my filterValues (and not is equal to) ? Should I use an other method ? Do I have to change the field type of OtherEmails__c ? Any advice ?

It would be much appreciated, thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: REST API Method: search leads with field that contains a specific string ?

Hi Lucas,

My understanding is that the Get Multiple Leads by Filter Type » Marketo Developers  API can use custom fields as filters, but you cannot set operators such as "contains". And I never heard that you would pass some * or $...

-Greg

View solution in original post

2 REPLIES 2
Grégoire_Miche2
Level 10

Re: REST API Method: search leads with field that contains a specific string ?

Hi Lucas,

My understanding is that the Get Multiple Leads by Filter Type » Marketo Developers  API can use custom fields as filters, but you cannot set operators such as "contains". And I never heard that you would pass some * or $...

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: REST API Method: search leads with field that contains a specific string ?

Finally, my questions are: How can I use the REST API method "Get Multiple Leads by Filter Type" to search leads whose filterType field contains one of my filterValues (and not is equal to) ? Should I use an other method ? Do I have to change the field type of OtherEmails__c ? Any advice ?

Like Greg said, I don't think there are any operators that would match here.

If you're doing a lot of work like this, I think it's better to replicate your lead database offline (using REST) into SQL and query it that way.  Even if you had the right operators it would probably be slooooooow.