{API}

Bulk email search

Bulk Email Search


Once the list has been received, we begin by indexing it followed by the searching process. Depending on the list size, this can take a while. It is for this reason that search results are not available immediately in the list submission response. In order to get results, you will need to periodically poll the API to check on the status of the search process until it is completed. Once it has completed you can retrieve the results.

Adding a List

We currently support uploading files by supplying either a URL to a Text file or by supplying the data directly in the body of the request. Below we'll go over both methods.

1. Sending A list by URL

The URL submitted must lead directly to the file and contain the protocol, as well as any authentication credentials the request needs. See the remote url section in the reference docs for more information about the protocols and acceptable authentication methods. The URL should be sent in the request as the input parameter with the input_location should be set to remote_url.

HTTP Request Example
                
POST https://trgtr.io/api/v1/email/bulk-search/create HTTP/1.1
    --header "Content-Type: application/json"\
    --header "Accept: application/json"\
    --data api_token={api_token}\
    --data input_location='remote_url'\
    --data task_name='Name of the Task'\
    --data input='https://example.com/my_file.txt'
                
            

2. Sending data Directly

Data submitted directly should exist as an array of arrays or an array of objects. See the supplied data section for more information. The data should be sent in the request as the input parameter with the input_location should be set to supplied.

HTTP Request Example
                    
POST https://trgtr.io/api/v1/email/bulk-search/create HTTP/1.1
    --header "Content-Type: application/json"\
    --header "Accept: application/json"\
    --data '{
        "api_token": {api_token},
        "input_location": "supplied",
        "task_name": "Name of the Task",
        "input": [
          "brandonc@fieldfastener.com",
          "brandonc@silverfoxprod.com",
          "brandoncupstid@comfortkeepers.com",
          "....",
          "...."
        ]
      }
                    
                
BODY PARAMS
api_token
required *
Your secret API Token used to request data.
input_location
required *
The type of input being supplied. Accepted values are "remote_url" and "supplied".
task_name
required *
This will be used to easly find Job by task_name.
input
required *
The input to be searched
direct_dial Get data with Direct Dial only. Accepted value "YES"
HTTP Response Example
                    
{
    "status": 200,
    "message": "Successfuly uploaded the list",
    "task_id": "5c9a14f05c73ba72bb0da642",
    "task_name": "Name of the Task",
    "emails": 1000
}
                    
                

Once you receive a response, you will want to store the value of task_id, as it will be used to check the status and eventually retrieve the results. Now you’re ready to start checking the status of the Bulk Search.

3. Checking The Status

Now that your list is running, you will need to poll the API and check the status periodically.

Request Task Status
                    GET https://trgtr.io/api/v1/email/bulk-search/status?task_id={task_id} HTTP/1.1
                
QUERY PARAMS
api_token
required *
Your secret API Token used to request data.
task_id
required *
The ID of task to check.
JSON Response
                    
{
    "status": "success",
    "message": "The task has completed and the results are ready for download.",
    "task_id": "5c9a14f05c73ba72bb0da642",
    "task_name": "Name of the Task",
    "created": "2019-03-26 12:02:56",
    "finished": "2019-03-26 12:09:30",
    "total_records": 1000,
    "coins": 1000,
    "percent_complete": 100,
    "execution_time": 105 Sec
}
                    
                

4. Download the Results

Now the Bulk Search has finished and the results are ready to Download.

Downloading the Results
                    GET https://trgtr.io/api/v1/email/bulk-search/results?task_id={task_id} HTTP/1.1
                
QUERY PARAMS
api_token
required *
Your secret API Token used to request data.
task_id
required *
The ID of task to check.
page The page to the results grab from.
items_per_page Number of data to be returned. You can use a maximum of 1000 items per page.
The default number of items per page is 25.

The data will be returned in JSON format.

JSON Response
                    
[
    {
        "company": "Derry Enterprises, Inc.",
        "first_name": "Brandon",
        "last_name": "Codina",
        "job_title": "Account Manager",
        "email": "brandonc@fieldfastener.com",
        "direct_dial": "815-243-0509",
        "mobile": "",
        "company_tel": "815-637-9002",
        "company_fax": "815-637-7575",
        "web": "http:\/\/fieldfastener.com",
        "address": "9883 N Alpine Rd, Winnebago, Machesney Park, IL 61115-1681 United States",
        "city": "Machesney Park",
        "state": "IL",
        "zip": "61115-1681",
        "country": "USA",
        "sic": "5085",
        "revenue": "32M",
        "employees": "46",
        "linkedin": "https:\/\/www.linkedin.com\/in\/brandon-codina-0486b5a2",
        "email_status": "valid"
    },
    {
        "company": "Silver Fox Productions, Inc.",
        "first_name": "Brandon",
        "last_name": "Conboy",
        "job_title": "Presentation Specialist",
        "email": "brandonc@silverfoxprod.com",
        "direct_dial": "",
        "mobile": "",
        "company_tel": "206-329-6805",
        "company_fax": "",
        "web": "http:\/\/www.silverfoxprod.com",
        "address": "568 1st Ave S Ste 500, King, Seattle, WA 98104-4445 United States",
        "city": "Seattle",
        "state": "WA",
        "zip": "98104-4445",
        "country": "USA",
        "sic": "7336",
        "revenue": "3.2M",
        "employees": "24",
        "linkedin": "https:\/\/www.linkedin.com\/in\/brandon-conboy-42b21a84",
        "email_status": "valid"
    },
    {
        "company": "Comfort Keepers, Inc.",
        "first_name": "Brandon",
        "last_name": "Cupstid",
        "job_title": "Director Of Operations",
        "email": "brandoncupstid@comfortkeepers.com",
        "direct_dial": "",
        "mobile": "",
        "company_tel": "937-832-2454",
        "company_fax": "937-324-1486",
        "web": "http:\/\/comfortkeepers.com",
        "address": "6640 Poe Ave Ste 200, Montgomery, Dayton, OH 45414-2688 United States",
        "city": "Dayton",
        "state": "OH",
        "zip": "45414-2688",
        "country": "USA",
        "sic": "8082",
        "revenue": "9.4M",
        "employees": "80",
        "linkedin": "https:\/\/www.linkedin.com\/in\/brandoncupstid",
        "email_status": "valid"
    },
    {
        ...,
        ...
    },
    {
        ...,
        ...
    }
]