Re: Rest API, Lead Partitions, and Error on Update Lead

Anonymous
Not applicable

Rest API, Lead Partitions, and Error on Update Lead

Hi there,

We are using REST API to submit new leads from a particular area of our website; we are using lead partitions. We use this call to submit leads as follows:

We start by getting our auth token: 
            url = new URL(restEndPoint.concat("/identity/oauth/token")
                    .concat("?grant_type=client_credentials")
                    .concat("&client_id=").concat(clientId)
                    .concat("&client_secret=").concat(clientSecret)
 
Next we try and add our lead:
 
            url = new URL(restEndPoint.concat("/rest/v1/leads.json")
                    .concat("?access_token=").concat(authenticationJson.getAccess_token()));
 
Passing it our lead JSON.

If it’s a new lead, we get a success response.  If it’s an existing lead, we get a partition update error. 

{"requestId":"2fe6#14a0f34bc75","result":[{"status":"skipped","reasons":[{"code":"1010","message":"Partition update not allowed"}]}],"success":true}

I know for SOAP API, if you leave the header blank, leads get assigned upon creation to the default partition, and upon update are updated in their current partition. So why are we getting an error message here?

Also as a workaround, we tried the following:

At that point, I request the lead’s details from Marketo via: 
                        url = new URL(restEndPoint.concat("/rest/v1/leads.json")
                                .concat("?access_token=").concat(authenticationJson.getAccess_token())
                                .concat("&filterType=email")
                                .concat("&filterValues=").concat(request.getParameter("email"))
                                .concat("&fields=id,leadPartitionId")
 
Now I have a lead partition ID, but not it’s name.  I need the darn name to do the update.  So I do:
 
                        url = new URL(restEndPoint.concat("/rest/v1/leads/partitions.json")
                                .concat("?access_token=").concat(authenticationJson.getAccess_token())
 
To get a list of valid partitions.  This is when we get the 611 error.

However, this seems unnecessary -- any help out there?
Tags (1)
5 REPLIES 5
Kenny_Elkington
Marketo Employee

Re: Rest API, Lead Partitions, and Error on Update Lead

Hey Jono,

Can you provide a raw example request where you're seeing this response?
Anonymous
Not applicable

Re: Rest API, Lead Partitions, and Error on Update Lead

Hi Jono

I have the same issue.
I feel REST "Update Lead API" is unuseful in multi partitions.

REST API "Update Leads" request parameter "partitionName" is not optional

https://community.marketo.com/MarketoIdeaDetail?id=08750000000KCOMAA4
 
Anonymous
Not applicable

Re: Rest API, Lead Partitions, and Error on Update Lead

Hi Jono,

Did you ever find an answer to this question? I'm having the exact same issue. I have an integration where I update lead records through the API. I first request for all ID's that match an email. Then I send an update for all of those ID's. Here's an example where my customer has four lead records with the same email address, but two of them are in a different partition. When I do the update, here is the response:

    "requestId":"<removed>",

    "result":[ 

        { 

            "status":"skipped",

            "reasons":[ 

                { 

                    "code":"1010",

                    "message":"Partition update not allowed"

                }

            ]

        },

        { 

            "id":1,

            "status":"updated"

        },

        { 

            "id":2,

            "status":"updated"

        },

        { 

            "status":"skipped",

            "reasons":[ 

                { 

                    "code":"1010",

                    "message":"Partition update not allowed"

                }

            ]

        }

    ],

    "success":true

}

I can't find anything that explains why this happens or how to fix it.

Anonymous
Not applicable

Re: Rest API, Lead Partitions, and Error on Update Lead

Hi Chris

According to API doc http://developers.marketo.com/documentation/rest/createupdate-leads/

Update Leads API can be specified one partition name per one call.

But your example is "but two of them are in a different partition".

I think you have to make a few calls to separate with each partition.

Anonymous
Not applicable

Re: Rest API, Lead Partitions, and Error on Update Lead

Hi Chris,

I am facing the similar issue. Are you able to fix this issue.?

If you fixed it please let me know. am also struggling with the same issue.

Thanks in advance

Jay