SOLVED

Re: Issue when using Lead API for syncLeadRequest

Go to solution
kiruthika_s
Level 1

Issue when using Lead API for syncLeadRequest

Hi,

 

I am trying to POST using Lead API syncLeadRequest (/rest/v1/leads.json). The record I am sending is only in the Global partition. When I send the below payload, I am expecting it to NOT get updated and get error as Lead not found( since I have mentioned the partitionName in which to look for based on the lookupfield). But the data is getting updated in the Global partition record. Why is that ? 

{

    "action""updateOnly",
    "partitionName""02. Partition B",
    "lookupField""email",
    "input": [
        {
            "email": "testemail@gmail.com",
            "Col A""Value A",
            "Col B""Value B",
        }
    ]
}
 
Appreciate your help!
1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Issue when using Lead API for syncLeadRequest

@kiruthika_s, the partitionName field isn't considered a co-lookup key in the POST request with the Email Address field. AFAICT, the Marketo REST API sees the entire lead database as one unit while making updates, not the virtual partitions created by creating the person partitions via Marketo > Admin. Also, with the default settings, duplicates aren't allowed in the person partitions. However, if you have intentional duplicates with partitions and workspaces, it is required to have the secondary dedupe field as leadPartitionID. Once you have that setup, you can use the leadPartitionID as the lookupField similar to email and Person ID (see the JSON payload below).

 

{

    "action": "updateOnly",
    "lookupField": "leadPartitionID",
    "input": [
        {
            "email": "a@example.com",
            "leadPartitionID": "1",
            "firstName": "Luke"
        }
    ]
}

 

Check out this article on Marketing Nation: https://nation.marketo.com/t5/employee-blogs/duplicates-with-partitions-and-workspaces-via-rest-api/...

View solution in original post

5 REPLIES 5
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Issue when using Lead API for syncLeadRequest

@kiruthika_s, the partitionName field isn't considered a co-lookup key in the POST request with the Email Address field. AFAICT, the Marketo REST API sees the entire lead database as one unit while making updates, not the virtual partitions created by creating the person partitions via Marketo > Admin. Also, with the default settings, duplicates aren't allowed in the person partitions. However, if you have intentional duplicates with partitions and workspaces, it is required to have the secondary dedupe field as leadPartitionID. Once you have that setup, you can use the leadPartitionID as the lookupField similar to email and Person ID (see the JSON payload below).

 

{

    "action": "updateOnly",
    "lookupField": "leadPartitionID",
    "input": [
        {
            "email": "a@example.com",
            "leadPartitionID": "1",
            "firstName": "Luke"
        }
    ]
}

 

Check out this article on Marketing Nation: https://nation.marketo.com/t5/employee-blogs/duplicates-with-partitions-and-workspaces-via-rest-api/...

kiruthika_s
Level 1

Re: Issue when using Lead API for syncLeadRequest

Thanks for the clarification @Darshil_Shah1 . 

We are building a pipeline to bring in data for custom fields. There might be duplicate records within the partitions in Marketo and same email in different partitions. We also do not have a unique Id other than the email in the source data. But we do have a BU id which corresponds to the person partition in our Marketo instances.

So came up with a solution, to match the record to the correct partition based on the BU id and then look up based on email id.

 

As per your input, would setting up leadPartitionID as secondary Dedupe field and using it as lookupField without mentioning email as lookup will work for our usecase ?

Setting up as below, would not lookup for all records in that partition Id and give "Multiple lead match lookup criteria" ?

"lookupField": "leadPartitionID",

I am just learning on how this Dedupe field works 🙂 

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Issue when using Lead API for syncLeadRequest

@kiruthika_s, Yes, you'd first need to request the Marketo support team to add a secondary dedupe key (BU ID or partition ID), and using the resultant composite key (which would be a unique key), you can update the exact person record you want to update amongst the duplicate (people with the same email address) records in your database.

kiruthika_s
Level 1

Re: Issue when using Lead API for syncLeadRequest

Thank you, @Darshil_Shah1. Will reach out to support to setup the Dedupe field.

Jo_Pitts1
Level 10 - Community Advisor

Re: Issue when using Lead API for syncLeadRequest

@kiruthika_s ,

you need to consider what forms of input you want the dedupe on.  Support can activate it on all, or just some (i.e. forms, API, list import etc).

 

Getting it wrong can cause all kinds of problems down the road.

 

Cheers

Jo