Reports via REST API
Need to automate your reports into your BI software, or simply pull your reports outside of LeadByte?
Our reports via REST API may be what you're looking for.
You are able to make a GET request to LeadByte and receive all your campaign data in a JSON format.
Getting started
To begin with, you'll need a Administrator REST API key with the "reports" permission checked.
As with all API keys, make sure it is activated and saved before using.
Calling the REST API
Now you have a REST API key with the correct permissions, you'll need to make the REST API call to LeadByte. On your REST API settings, scroll down the bottom of the page and you'll see a group of expandable report choices:
Expand one of these for instructions on how to call the REST API for each of the reports.
Things you might need
When LeadByte is asking for a Campaign ID or a Responder ID, it is referring to the database ID. You can find this by editing your Campaign and checking the URL. In my example below, I would use ID 9:
Example call
I'm looking to pull a Campaign summary report for my example Campaign for the month of July.
Below is what I would call LeadByte with:
The response received back (once beautified) would look like this:
{
"status": "Success",
"message": "OK",
"data": [
{
"campaign": {
"id": "9",
"name": "Example Campaign",
"reference": "EXAMPLE-CAMPAIGN"
},
"leads": 82,
"valid": 74,
"invalid": 8,
"pending": 0,
"rejections": 63,
"approved": 11,
"returns": 0,
"supplierCost": 37.5,
"emailCost": 0,
"smsCost": 0.026,
"validationCost": 0.0255,
"revenue": 250,
"profit": 212.4485,
"currency": "GBP"
}
]
}
Obviously, this call and response will change for each report you pull, however, the format will always be:
Call to LeadByte > GET
Response back from LeadByte > JSON
FAQ
1. What date presets can I use?
You can use the "datePreset" variable with the following values: today / yesterday / this_week / last_7d / lastweek / last_30d / this_month / last_month. For example - &datePreset=last_7d
Comments