Get File (v2)

The getfile API allows users to get the validation results file for the file been submitted using sendfile API. Please refer to the C# example for details.

GET /v2/getfile


URL Parameters

  • Parameter
  • api_key
    Your API Key, found in your account.
  • file_id
    The returned file ID when calling sendfile API.

If you want to call the API from your browser to test it, all you have to do is to replace the API KEY with your key and the FILE ID with the returned file ID from sendfile API:[replacewithyours]

GetFile Code Samples

  • Visual Basic
  • C#
  • PHP
  • Java
  • Python
  • Swift
' Complete API Libraries and Wrappers can be found here: 

' Get File Sample in

Private Shared Sub GetFileAPITest()
  Dim apiKey As String = "replace with your api key here"
  Dim fileID As String = "replace with the returned file ID when calling sendfile API"
  Dim dir As String = "C:	emp"

        Dim filePath = GetFileAsync(apiKey, fileID, dir).Result
        Console.Write($"File {filePath} retrieved successfully.")
    Catch ex As Exception
    End Try

End Sub

Public Shared Async Function GetFileAsync(ByVal apiKey As String, ByVal fileID As String, ByVal dir As String) As Task(Of String)
    If String.IsNullOrEmpty(apiKey) Then Throw New Exception("Error: apiKey is required")
    If String.IsNullOrEmpty(fileID) Then Throw New Exception("Error: fileID is required")
    Dim uri As Uri = New Uri($"{apiKey}&file_id={fileID}")

    Using client = New HttpClient()
        Using request = New HttpRequestMessage(HttpMethod.Get, uri)
            Using response = Await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False)
                Using streamToReadFrom As Stream = Await response.Content.ReadAsStreamAsync()

                    If response.IsSuccessStatusCode = False Then
                        Dim [error] = $"StatusCode = {CInt(response.StatusCode)}, Content = {response.Content.ReadAsStringAsync().Result}"
                        Throw New Exception([error])
                    End If

                    Dim filePath = Path.Combine(dir, response.Content.Headers.ContentDisposition.FileName)

                    Using streamToWriteTo As Stream = File.Open(filePath, FileMode.Create)
                        Await streamToReadFrom.CopyToAsync(streamToWriteTo)
                    End Using

                    Return filePath
                End Using
            End Using
        End Using
    End Using
End Function

// Complete API Libraries and Wrappers can be found here: 

// Get File Sample in C#

private static void GetFileAPITest()
    string apiKey = "replace with your api key here";
    string fileID = "replace with the returned file ID when calling sendfile API";
    string dir = @"C:	emp";  // specify the directory where you want to save the results file

        var filePath = GetFileAsync(apiKey, fileID, dir).Result;
        Console.Write($"File {filePath} retrieved successfully.");
    catch (Exception ex)

public static async Task<string> GetFileAsync(string apiKey, string fileID, string dir)
    if (string.IsNullOrEmpty(apiKey))
        throw new Exception("Error: apiKey is required");
    if (string.IsNullOrEmpty(fileID))
        throw new Exception("Error: fileID is required");

    Uri uri = new Uri($"{apiKey}&file_id={fileID}");

    using (var client = new HttpClient())
    using (var request = new HttpRequestMessage(HttpMethod.Get, uri))
    using (var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
    using (Stream streamToReadFrom = await response.Content.ReadAsStreamAsync())
        if (response.IsSuccessStatusCode == false)
            var error = $"StatusCode = {(int)response.StatusCode}, Content = {response.Content.ReadAsStringAsync().Result}";
            throw new Exception(error);

        var filePath = Path.Combine(dir, response.Content.Headers.ContentDisposition.FileName);
        using (Stream streamToWriteTo = File.Open(filePath, FileMode.Create))
            await streamToReadFrom.CopyToAsync(streamToWriteTo);
        return filePath;

  // Complete API Libraries and Wrappers can be found here: 

  $request = new HttpRequest();
    'api_key' => 'replacewithyours',
    'file_id' => 'replacewithyours'
    'Postman-Token' => '0a6c40b8-0cd4-4dbb-a57e-422558e7ab6a',
    'cache-control' => 'no-cache'
  try {
    $response = $request->send();
    echo $response->getBody();
  } catch (HttpException $ex) {
    echo $ex;

  //Complete API Libraries and Wrappers can be found here: 

  OkHttpClient client = new OkHttpClient();

  Request request = new Request.Builder()
    .addHeader("cache-control", "no-cache")
    .addHeader("Postman-Token", "d0b7d318-f3f6-47fb-842d-5622b26592c1")
  Response response = client.newCall(request).execute();

    # Complete API Libraries and Wrappers can be found here: 
  import http.client

  conn = http.client.HTTPConnection("bulkapi,zerobounce,net")
  payload = ""
  headers = {
      'cache-control': "no-cache",
      'Postman-Token': "9f615d7e-60af-4746-9bcc-317b1f80a6bb"
  conn.request("GET", "v2,getfile", payload, headers)
  res = conn.getresponse()
  data =

  // Complete API Libraries and Wrappers can be found here: 

import Foundation

let headers = [
  "cache-control": "no-cache",
  "Postman-Token": "6c8cb1cb-25ed-4e56-b4cb-65e949b8bdd1"

let request = NSMutableURLRequest(url: NSURL(string: "")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
  } else {
    let httpResponse = response as? HTTPURLResponse


Endpoint Response

Successful Response


The getfile API returns the validation results file. The returned content type is "application/octet-stream". You can get the file name from response.Content.Headers.ContentDisposition.FileName. If you are calling the API directly from the browser, you can either save or open the results file from the browser.

Error Response

      "success": false,
      "message": "Error messages"