Campaign and Lead Source Report API

Overview

Use the Campaign and Lead Source Report API to get real-time reports on performance by Lead Source and Campaign. The API returns data on number of leads, scoring averages, and performance by lead source or campaign. Using Google Sheets or Excel, you can easily link this API into local reports.

Endpoint (5.9)

https://feed-api.ehawk.net/report/

The API accepts both HTTPS POST and HTTPS GET.

For GET use the format:

https://feed-api.ehawk.net/report/function/?keyword=value

When using POST, make sure to have Content-Type: application/x-www-form-urlencoded

CRUL POST API call example:

$ curl -X POST -H Content-Type:application/x-www-form-urlencoded -d 'apikey=your_apikey' https://feed-api.ehawk.net/report/function/

Function

Options for function

Select the action to take using function values:

leadsource get data on lead source performance. For example:
https://feed-api.ehawk.net/report/leadsource?apikey=your_apikey

campaign get data on campaign performance. For example:
https://feed-api.ehawk.net/report/campaign?apikey=your_apikey

Keywords

Every API call requires the apikey and you can add keyword and values to customize your report.

Keyword Value and Format
apikey Your E-HAWK Vetting API KEY (required)
period Number of days to include in the report. Value can be 1 to 35. Default is 5. Set to 15 for the last fifteen days. For current day, use 1.
min_leads Minimum leads for the source or campaign within the period. Default 100. To filter for campaigns with 10 or more leads, set to 10.
search Search by Lead Source or Campaign Name. Format is search=value. Search is value + wildcard.
threshold Threshold score setting. Default is very_high (a risk score of -71 to -100).

Options are: low some medium high very_high

for scoring bands see, How is the risk score calculated?
orderBy Sort options: (default is threshold)
threshold largest percent over threshold
threshold_count number of leads over threshold
count Count of leads
avg Average score of leads
name Source or Campaign Name, A to Z
name_desc Source or Campaign Name, Z to A

As an example, calling the API POST for a campaign report of the last 10 days and minimum lead count of 10 with CURL:
$ curl -X POST -H Content-Type:application/x-www-form-urlencoded -d 'apikey=your_apikey&period=10&min_leads=10' https://feed-api.ehawk.net/report/campaign/

And with GET:

https://feed-api.ehawk.net/report/campaign?apikey=your_apikey&period=10&min_leads=10

Response

The report is returned as a JSON with a maximum of 500 items/rows in the format:

Status Codes

Status Response
200 OK (no errors)
502 Invalid APIKEY or URL

Google Sheets Integration

You can integrate this report into a Google Sheet for real-time reporting. Just follow the instructions at https://github.com/bradjasper/ImportJSON. Create a Google Sheet, then add the script to the Script Editor. In the top cell enter the URL and keywords. For example, to get a campaign report:

=ImportJSON("https://feed-api.ehawk.net/report/campaign?apikey=your_apikey", "/response")

When the gSheet opens the report data will refresh.

You can also use Excel on Windows to build the same real-time reporting using Power Query.

Excel Report