Rest API, Lead Partitions, and Error on Update Lead | Community
Skip to main content
December 13, 2014
Question

Rest API, Lead Partitions, and Error on Update Lead

  • December 13, 2014
  • 3 replies
  • 2321 views
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?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Kenny_Elkington
Adobe Employee
Adobe Employee
December 15, 2014
Hey Jono,

Can you provide a raw example request where you're seeing this response?
January 14, 2015
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
 
July 2, 2015

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.

July 2, 2015

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.