Skip to main content

Download Result

Download the results of your completed email validation jobs in either CSV or JSON format.

API Reference

Endpoint

GET https://api.cliova.com/v1/webhooks/email-validations/bulk-emails/{id}/download-result?apiKey=${apiKey}&output=${output}&verifiedOnly=${verifiedOnly}
List ID

The id parameter is the identifier of your completed validation job (e.g., list_12345 or 11bb57b9-0901-4fb9-9664-6548cdcd3172)

Parameters

Path Parameters

ParameterRequiredTypeDescription
idYesstringThe unique identifier of your completed validation job

Query Parameters

ParameterRequiredTypeDescriptionDefault
apiKeyYesstringYour API authentication key-
outputNostringOutput format for results. Options: csv or jsoncsv
verifiedOnlyNostringFilter for verified emails only. Options: true or falsefalse

Code Examples

resultDownloader.js
async function downloadValidationResults(
apiKey,
listId,
output = "csv",
verifiedOnly = "false",
outputFilename = `validation_results_${listId}.${output}`
) {
const baseUrl =
"https://api.cliova.com/v1/webhooks/email-validations/bulk-emails";
const url = `${baseUrl}/${listId}/download-result?apiKey=${apiKey}&output=${output}&verifiedOnly=${verifiedOnly}`;

try {
const response = await fetch(url, { method: "GET" });
if (!response.ok) {
const errorData = await response.json();
throw new Error(errorData.error?.message || "Download failed");
}

// Handle response based on output format
if (output === "json") {
const jsonData = await response.json();
// Handle JSON data
return jsonData;
} else {
// Handle CSV download as blob
const blob = await response.blob();
const downloadUrl = URL.createObjectURL(blob);

const link = document.createElement("a");
link.href = downloadUrl;
link.download = outputFilename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);

setTimeout(() => URL.revokeObjectURL(downloadUrl), 1000);
}
} catch (error) {
console.error("Error downloading results:", error);
}
}

// ----- Usage Example -----
document.getElementById("downloadButton").addEventListener("click", () => {
downloadValidationResults("your_api_key", "list_12345", "json", "true");
});

Best Practices

Download Strategy

Efficient Downloads

Follow these guidelines for optimal download handling:

  • Verify validation is complete before downloading
  • Choose the appropriate output format based on your needs:
    • Use CSV for spreadsheet compatibility and smaller file sizes
    • Use JSON for easier programmatic processing
  • Use verifiedOnly='true' to filter out invalid emails
  • Save results immediately to avoid re-downloads

Need Help?

Support Resources