Caching for Lead Database REST API? | Community
Skip to main content
New Participant
April 30, 2024
Question

Caching for Lead Database REST API?

  • April 30, 2024
  • 1 reply
  • 2083 views

Hello,

After creating a new Lead via a Lead Form, how long should I expect to wait until the response from the Lead Database API gets updated with the new Lead?

Thank you,

-Michael

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
April 30, 2024

There's no fixed delay. The form submission is asynchronous, could take a few seconds or maybe even a minute under load. Can you explain exactly what you're trying to do? We need to know there's not an XY Problem.

New Participant
May 6, 2024

We have lead forms on our site, however, we only want to display a lead form is a user hasn't filled one our before (at least by making our best guess at it.)

 

We follow this documentation to call the Get Multiple Leads By Filter Type REST endpoint and check if any Leads have been submitted with the token saved in the _mkto_trk cookie:

https://developers.marketo.com/blog/get-a-visitors-cookie-id-and-then-query-associated-lead-data/

 

If we don't find the cookie value in this Lead database, then we display the form. However, if we do find it, then we hide the form because we know they are already being tracked.

 

We've received some feedback that some viewers are continuing to see lead forms for up to 20 minutes after submission. I haven't reproduced this myself, though I have reproduced up to a 5 minute delay between submitting a form and seeing my Lead/cookie token reflected in the JSON response.

 

I'm curious if Marketo documents any expected time for this API response to update with the latest submissions so that we could also set expectations for our own audience?

Thanks,

-Michael

SanfordWhiteman
New Participant
May 6, 2024

That’s a convoluted approach that also opens you to a simple DoS attack.

 

Marketo Forms support Known Visitor HTML (“If known visitor, show custom HTML” in Form Editor). You can use this to suppress future forms if the cookie is already associated. There’s no need to guess or use the API, simply enable KV HTML.