LeadsFriday

Get Completed Export Links With Webhooks

Let your application know when a LeadsFriday request is finished instead of repeatedly checking whether the file is ready.

When you submit a LeadsFriday export through an automated workflow, there’s one obvious question: how does your system know when the export is finished? You could keep checking the request every few minutes. Or LeadsFriday can tell your application when something has happened. That’s what webhooks are for.

What a webhook does

A webhook lets one application send information to another application when an event happens.

In this case, your system submits a request to LeadsFriday.

LeadsFriday processes it.

When the relevant completion event occurs, a webhook can send information to the endpoint you’ve configured.

Your application can then continue the workflow.

You don’t need a person refreshing an order page or a script asking for the status every few seconds.

Why use webhooks for exports

Scraping and enrichment aren’t always instant.

One export may finish quickly while another containing hundreds of thousands of records may take considerably longer.

If your application constantly checks LeadsFriday asking "Is it finished yet?", most of those requests don’t accomplish anything.

A webhook-based workflow can be cleaner.

Your application submits the request and waits.

When LeadsFriday sends the completion event, your system handles the next step.

Set up your webhook endpoint

You’ll need an endpoint in your own application that can receive the webhook request.

Configure that endpoint according to the LeadsFriday webhook documentation.

Your endpoint should be available when the event is sent and should be able to process the expected payload.

Don’t build the entire automation at once.

Start by receiving the webhook and logging the information.

Once you know your endpoint receives events correctly, add the next actions.

What happens when an export finishes

When a supported request reaches the relevant completion state, LeadsFriday sends the webhook event to your configured endpoint.

The payload should give your system the information it needs to identify the request and handle the completed result according to the current API documentation.

Your application can match the event to the original request identifier you stored when submitting the export.

That connection is important when you’re running multiple requests at the same time.

Handle the completed result

Once your application knows an export is complete, you can decide what happens next.

For example, your workflow might:

  • Store the completed export
  • Import data into your internal system
  • Start another enrichment step
  • Update an order in your application
  • Notify a team member
  • Move the request to the next stage of a client workflow

Plan for failed deliveries

This is where the API and webhooks become especially useful together. The API starts the work. The webhook tells your system when it’s time to continue.

Don’t assume every webhook will always reach your application perfectly.

Your server could temporarily be unavailable. Your endpoint could return an error. Your application could have a bug.

Build your workflow so one missed event doesn’t permanently lose an export.

Keep the LeadsFriday request identifier in your own system and use the available status functionality as a fallback when necessary.

Also make sure your endpoint doesn’t accidentally process the same completion event twice if a webhook is retried.

Keep your webhook secure

Your webhook endpoint is part of your application, so treat it like one.

Use the verification or security mechanism specified in the LeadsFriday webhook documentation, where available.

Don’t trust arbitrary requests simply because they arrive at the same URL.

And avoid exposing sensitive information through logs that anyone can access.

Test before going live

Run a small export from beginning to end.

Submit it through the API.

Store the request identifier.

Wait for the webhook.

Confirm that your application receives the event and associates it with the right request.

Then test what happens when something fails.

Once those pieces work, you’re ready to build larger automated workflows.

Submit through the API - let LeadsFriday process the data - use the webhook to continue when the result is ready.

Sharehttps://www.leadsfriday.com/blog/webhooks-for-completed-orders/
1,000 free leads on signup

Try It With Your Own Search

Paste your search URL and see the results for yourself. Pay only for what you need, and your credits never expire.