API - Webhook Error

Michael_Oslin
Level 3

API - Webhook Error

Has anyone ever seen this error on a webhook activity.

{"success":false,"error":"No lead fields to import","logId":"d3039c09-6d16-4b8f-ab1a-03bad214a872"}

I'm trying to generate a call to Dun & Bradstreet to append data to people after they submit a form.

I get a "200" for my response code (i.e. It's being sent) but the "No lead fields to import" keeps coming back as my error.

Any thoughts??

Thank you-

Michael

11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator

Re: API - Webhook Error

Isn't that the literal JSON response payload from DNB? What makes you think this is a Marketo error?

Michael_Oslin
Level 3

Re: API - Webhook Error

I'm not sure, I have a ticket with D&B to check as well.

I'll update you.

Michael_Oslin
Level 3

Re: API - Webhook Error

Sanford,

It looks like the error was due to the Country passing wasn't matching their requirement of Country ISO, which means I'll need to figure out a way to change data value when the leads come in.

Currently working on a Smart Campaign with Flow of Change Data Value:

If: Country is United States

Attribute: Country Code New Value: US

​A bit daunting considering there are 240 countries, but I cannot think of a better way. Worried that the "FLOW" step will get bogged down or wont run properly.

Thoughts?

Michael

Rachel_Noble
Level 9 - Champion Alumni

Re: API - Webhook Error

Michael,

Data standardization is a good data hygiene practice whether or not you're passing this data to D&B. There are a number of ways to do this, but a smart campaign for the major countries in which your leads reside is probably a good idea. There are also webhooks available to help you with this.

If you're concerned about the webhooks taking up too many API calls, consider making smart campaigns to standardize the most common countries you have (such as the US) and use a webhook for the others.

Rachel

Michael_Oslin
Level 3

Re: API - Webhook Error

Thank you Rachel.

Yes, I ran a smart campaign to standardize what I call Tier 1 and Tier 2 countries (roughly 100 countries) and separated into 2 smart campaigns.

It took a bit of time to create but it wasn't that bad.

Now the API is working great and with the side benefit of getting standardization on the 2 letter country code.

Thanks again for your input.

Michael

SanfordWhiteman
Level 10 - Community Moderator

Re: API - Webhook Error

Webhooks don't use API calls.

SanfordWhiteman
Level 10 - Community Moderator

Re: API - Webhook Error

I know you already built the Flow, but unsurprisingly*, I would use a FlowBoost webhook here. Include the ISO name-to-code list (it's available for download here and in other places) in the payload and this one-liner:

countryAlpha2Match = ISOAlpha2Map.reverse().find( (countryISO) => new RegExp('^' + countryISO.Name + '(\\s|$)','i').test( {{lead.Country}} ) );

(That's about as tight as you can get a case-insensitive prefix pattern match over a JSON array-of-objects!).

The result looks like:

  "countryAlpha2Match": {

    "Name": "Zambia",

    "Code": "ZM"

  }

Then you map countryAlpha2Match.Code back to a field on the lead, and that's the field you send to D&B.

*I am the tech lead for the FlowBoost platform.

Michael_Oslin
Level 3

Re: API - Webhook Error

Sanford,

When I go to create a webhook, my only option is the following:

Webhook.png

I don't see any other options, honestly not even sure what a "FlowBoost" webhook is. Could you please provide some more guidance?

As always, thank you!

SanfordWhiteman
Level 10 - Community Moderator

Re: API - Webhook Error

It's a whole big-little thing​ that gives you a full JS engine within a Marketo flow.