All Collections
Reporting
Emails Export API
Emails Export API
Joel Lang avatar
Written by Joel Lang
Updated over a week ago

Barilliance collects emails from visitors as they are typed in your website. These emails can be exported automatically via API calls.

Getting API Access

To get access to the API you need a unique URL that holds a random key, known only to you.
To get the API key, visit the 'settings' section of the management console. A key URL looks like this

https://cbar.barilliance.com/api/export.php?sid=575&key=c4cdc2ed222b9693fce8659xxxx6641b

Exporting Visitors Emails

To get the list of all emails of visitors who have visited during specific dates add the following parameters to the API access URL.

&action=collected&date_from=2021-03-08&date_to=2021-03-11&optedin=true
  • The date range represents the last visit time, not the date of email capture

  • optedin = true/false/all - the most recent opt in status of the visitors emails

  • For legacy reasons you can use action = collected_not_optout instead of collected. this is the same as using action = collected, optedin = false

Exporting emails of Visitors who actively opted out

Get the list of emails of visitors who have actively opted out using the unsubscribe link in emails in specific date range. use the following api parameters:

&action=optout&date_from=2021-03-11&date_to=2021-03-11

  • Be aware that these are the users who have actively opted out. To get all visitors with opted out status (e.g. never opted in) use the action in 'Exporting Visitors Emails' above.

Exporting Sent Emails

To get a csv list of all the sent emails with email types for specific dates add the following parameters to the API access URL

&action=sent&date_from=2021-03-11&date_to=2021-03-11

Sample output:
โ€‹

time,email,email_type
"2021-02-08 17:42:06",bill_clinton@comcast.net,60
"2021-02-08 17:42:06",george_bush@verizon.net,62
"2021-02-08 17:44:03",barak_obama@telecom.co.nz,60
"2021-02-08 17:46:02",john_kennedy@rogers.com,63
"2021-02-08 17:46:03",abraham_lincoln@gmail.com,62

The 3rd parameter is a number with these values:
The tens specify the email provider (e.g. 6 = amazonSES)
The ones represent the email type:
โ€‹0: shopping cart abandonment. 1: email my cart. 2: browse abandonment. 3:post purchase email, 4: back to stock reminder 5: visit summary email

Exporting emails captured by Email Capture Popup rule

To export email addresses captured specifically by 'Email Capture Popup' use this format:

&action=capture_form&date_from=2021-03-11&date_to=2021-03-11&optedin=true

  • The date range represents the last visit time, not the date of email capture

  • optedin = true/false/all - the most recent opt in status of the visitors emails

General notes

  • Date format is YYYY-MM-DD in New York time zone

  • Return values are email addresses, on per line

  • Possible return values in case of error: invalid access key, invalid action, no results, invalid sid (wrong site id), wrong date format

  • Results are limited to 30000 emails

  • to save a file in Microsoft Excel format add &excel=true to the URL

Did this answer your question?