API Example Admin Daily Performance Report

From InClickAdServer

Administrator Report - Daily Performance

This API Service Reqeust will generate the Daily Performance Report data based on the provided filter options. =The Code Example

Breaking Down the Code

This require references the API configuration file allowing your code to utilize the inClick Developer API Client Objects.


These requires (includes) contain the API Objects and Classes needed for this API Service Request.


This is where we create an instance of the classes needed to perform this service request.


These three lines are used to set the date range. Line one is to set the date in the past. In this case, it is set for 13 days ago. Line two is the current server time. The third line sets the date range object with two parameters, the starting date and the ending date. in this example, we are looking at the last 14 days of data (including today).

WARNING: Values for $report_request->setDateRange are integer timestamps. Do not enter date formatted values! For example, the timestamp value for May 24, 2023 is 1684900800.

These five lines are used to set the various optional filter options:

Object Required Description
setResultsPerPageNoThis numeric value will determine how man results will be returned in this request. Typically, this is the number of results to show in a page.
setCurrentPageNoThis numeric value will tell the server what page to retrieve.
setAdvertiserIDNoThis numeric value, the advertisers account number, will filter the report to this advertisers activity
setChannelIDFilterNoThis numeric value, the channel ID, will filter the report to this channels activity
setPublisherIDNoThis numeric value, the publishers account number, will filter the report to this publishers activity.

This line is the API Service Request that sends the request for this report to your inClick Ad Server deployment. If a failure occurs, the error code and corresponding error message are returned as objects:

$report_result->getErrorCode()
$report_result->getErrorMessage()

If this request is successful, the report data assigned is available in the following object:

$report_result->getReturnValue()

This section of code is provided to give you a visual confirmation of what occurred, or to let you know what error occurred.

Updated 11/14/2016