Getting 1007 error through API createOrUpdate

budzynmSlice
Level 1

Getting 1007 error through API createOrUpdate

We have a third-party form on our branded site that is being submitted to Marketo via the REST API using createOrUpdate. We are getting this error fairly often:

result":[{"status":"skipped","reasons":[{"code":"1007","message":"Multiple lead match lookup criteria"}]}],"success":true}

 

As a result we aren't getting inquiries captured in Marketo (and eventually over into SFDC). We are using the email address as the matching criteria since these forms are how our customers can provide updates to us as well as prospects can make inquiries (we can't stop users from using the forms however it suites them). And we can't reasonably expect to have no duplicate emails.

 

Currently, the form is capturing all the inputs in custom fields (except for email) and we have an automation that copies the values from the custom fields into the standard fields (for example, submission_firstname >> first name) only if the standard fields are empty (so we don't overwrite existing values from previous form submissions or--more importantly from updates in SFDC). The custom fields from the form submission are then used to populate the description field in a task in SFDC so the actual form submission is captured as a unique record along with the corresponding values.

 

We need to solve the 1007 error and from what I gathered from Support and based on experience we have a couple of options:

1. Migrate off the API call to a rePOST to a Marketo form (since form POSTs auto-merge). I know this is no longer officially supported by Marketo, though I did have it unofficially recommended to me by another Support person. In a previous life I have leveraged this option.

2. Migrate off the API call and use the Javascript form submission on the page to rePOST the form (officially supported by Marketo)
3. Continue with the API route and when receiving 1007 call the API merge POST using one of the existing matches to merge the new form submission against.

 

I have spoken to our developer regarding 1 and 2 and their concern is the lack of descriptive return codes. I believe there are only there supported in the rePOST route: 200 - Success; 404 - Error; 429 - Exceeded Limit. They would prefer sticking with the API route (not that I can blame them).

 

Anyone have come across this scenario and have a recommended solution/experience they can share?

 

Thanks!

-mark

Tags (1)
4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Getting 1007 error through API createOrUpdate

To be clear, it's not really an error, it's a documented exception because the server state doesn't match the requirements of the call. That is, there are duplicates, and that's not what the endpoint is for.

 

I wouldn't recommend hitting the forms endpoint from your server. The per-source-IP limit is too restrictive to funnel all your submissions through one IP, so there's a clear DoS vulnerabilty. There's also a self-evident DoS concern with the REST API, of course, and it would get even worse with option [3].

 

But the rate limits are extremely generous when you use option [2] — 43,200 posts per day per source IP — and you get the functionality you need. I wholeheartedly recommend the Forms 2.0 JS API. Not sure how much more descriptive you need than the standard onSuccess, and you can add an onError (see my blog post about that).  A form post goes into a queue so it's not possible to give real-time feedback about the merge anyway.

budzynmSlice
Level 1

Re: Getting 1007 error through API createOrUpdate

Thanks for the detailed response!

 

We went with the JS API for the form POST and that appears to have addressed the 1007 issue.

What I am noticing, though, is that when there are matching records (based on duplicate emails), the form is updating a converted lead record and not one of the matching non-converted lead records. As a result, we are getting errors in the Flow (for example, we are creating a Task with the contents for each form submission, and we can't create a Task for a converted lead).

 

Any suggestions on how to address that?

SanfordWhiteman
Level 10 - Community Moderator

Re: Getting 1007 error through API createOrUpdate

The form will update the most recently updated record with that email address (so kind of a vicious circle). Is there a way for you to ensure one of the others is touched more recently?

budzynmSlice
Level 1

Re: Getting 1007 error through API createOrUpdate

Well, that's annoying. 

Can Marketo's SFDC integration ever get smart enough to recognize a converted lead?

 

Meanwhile, what we are landing on is a SFDC fix that whenever a contact record is created (including from a lead conversion) to fire off a time-based workflow that updates--on the contact--a hidden 'non-user' field forcing the last modified date to update. This seems like the simplest solution.

 

Considering that a converted lead has links to the newly created contact, account (and potentially the opportunity), Salesforce would normally need to update the lead after those related records are created so it would have the more recent last modified date. I'm thinking this fix would solve that.

 

Am I missing anything?