Summary
The Revenue Opportunity Endpoint enables API access to your Revenue Opportunity reports. This endpoint accepts two forms of requests - one to list the available reports, and another to retrieve a particular report's data. In the following article we'll walk through each of these requests and provide some examples.
Note: Currently, all requests use the GET HTTP method.
revenue-opportunity/report-date
https://api.bluetriangletech.com/revenue-opportunity/report-date
This URL is used to access the available reports, each with a unique epoch report date. You can make a simple GET request to list all available reports, reports within a certain time period, or the latest report.
Note: If you use our Brand Opportunity, be sure to specify that for the salesType parameter.
Required Parameters
|
Name |
Type |
Description |
Options/Constraints |
|---|---|---|---|
|
prefix |
string |
The site identifier in your JavaScript tag. |
Lower case letters only. |
|
salesType |
string |
The type of data. |
"revenue" or "brand" |
Optional Parameters
|
Name |
Type |
Description |
Options/Constraints |
|---|---|---|---|
|
start |
integer |
The start of the time period over which to list the reports. |
epoch seconds |
|
end |
integer |
The end of the time period over which to list the reports. |
epoch seconds |
|
latest |
string |
Only return the latest report date. If used, start/end dates are overwritten. |
"true" or "false" |
Example
This example lists the latest Revenue Opportunity report for our demo site.
https://api.bluetriangletech.com/revenue-opportunity/report-date?prefix=demo&salesType=revenue&latest=true
Note: Remember, you'll need to set your request headers to authenticate (See The Blue Triangle API - Overview > How to Connect to the API).
revenue-opportunity
https://api.bluetriangletech.com/revenue-opportunity
This URL is used to retrieve the report data given the timestamp of the report date.
Required Parameters
|
Name |
Type |
Description |
Options/Constraints |
|---|---|---|---|
|
prefix |
string |
The site identifier in your JavaScript tag. |
Lower case letters only. |
|
salesType |
string |
The type of data. |
"revenue" or "brand" |
|
reportDate |
integer |
The date in epoch (sec) of the requested report. |
epoch seconds |
Optional Parameters
|
Name |
Type |
Description |
Options/Constraints |
|---|---|---|---|
|
device[] |
string |
Get the data for one or more specific devices. By default, all available data is returned. |
Desktop, Mobile or Tablet. Multiple may be specified. |
|
pageName[] |
string |
Get the data for one or more specific pages. By default, all available data is returned. |
Multiple may be specified. |
Example
This example retrieves the revenue report for the specified date.
https://api.bluetriangletech.com/revenue-opportunity?prefix=demo&salesType=revenue&reportDate=1594908000