Search code examples
apimarketo

Marketo API error 1006: ignore fields that don't match


I am trying to do a simple Lead create/update via the Marketo API from a web form. I am posting data to multiple sources, not just Marketo, so I have other fields that don't match any fields during the Marketo update. This throws an API error of 1006 http://developers.marketo.com/documentation/rest/error-codes/

Here is an example JSON:

{
    "action": "createOrUpdate", 
    "lookupField": "email"
    "input": [
        {
            "firstName": "Matthew Edward",  
            "campaign_id": "testingCID", 
            "lastName": "King", 
            "email": "[email protected]"
            "message": "", 
        }
    ]
}

Since "campaign_id" and "message" aren't fields in the Lead capture, it throws the error and won't import anything. I would rather not write a function that cleans this data JUST for the the Marketo import. It would make future web forms more scalable if we didn't have to create a "blacklist" of fields that can't be imported into Marketo.

Is there anyway to avoid this error? Thanks.


Solution

  • This is by design. As you mentioned, the Marketo API will return the 1006 error code if a lead field you attempt to update does not exist in Marketo.

    If writing a function that excludes this data is not an option, another option would be to create custom fields in Marketo for each custom field you need to update via the API.