Customizing an API Request
Taylor Dunne avatar
Written by Taylor Dunne
Updated over a week ago

The MNTN reporting platform allows you to generate an API request to export data for ingestion into your internal systems. A standard API request looks like the below link and can be pulled directly from any custom data table in your Reporting Dashboard. You can also further customize the API request by editing and defining the various parameters.

In this article, we'll cover the required parameters for creating an API request:

Pulling an API Request Directly from a Custom Report

The easiest way to create an API Request is to simply copy the existing link from any data table within your custom reports.

In the top-right hand corner of any custom data table, you will find a button that will allow you to 'Create R2 API Request.' This is only available for custom reports under 'My Reports,' and not for any of the default reports at the top.

Once you click this button, a new API Request will generate (see below). This will automatically include all data parameters and formatting from the data table that it was pulled from, as well as the unique API key for your account.

You can copy this request and use it immediately to export data for ingestion into your internal systems.


Building & Customizing your API Request

Setting the API Key

Your API key is used for the purpose of accessing the reporting data outside the MNTN reporting platform. You can locate your unique API key in the My Account section of the platform.

Once you've located your API key, you'll input it in the key parameter of the API request.

Defining the Begin Date

You can set the date range of the data you'd like to pull using the Begin Date parameter. Dates should be specified in YYYY-MM-DD format. If you are inputting a hardcoded date, you'll need to also specify the End Date.

Alternatively, you can utilize one of the time shortcuts outlined below. Note that all time shortcuts are T-1 and will not provide the current day's data in the final output.

  • D - The prior day of data

  • Y - The data from two days prior

  • WTD - The current week of data beginning with Sunday as the first day of the week

  • LastWeek - The prior week of data beginning with Sunday as the first day of the week

  • MTD - The current month of data

  • LastMonth - The prior month of data

  • Thirty - The last 30 days of data

  • YTD - The current year of data

If you are utilizing one of the above time shortcuts, you don't need to specify the End date parameter.

Defining the End Date

You can set the end date of the date range you'd like to pull with the End Date parameter. Dates should be specified in YYYY-MM-DD format. If you have hardcoded the Begin date, you'll need to specify the End date.

Setting the Format

You can define the format that you would like your data returned with the Format parameter. The format options are outlined below.

  • CSV - Comma separated values (downloads to your computer in CSV format)

  • Excel - Fully formatted Excel spreadsheet (downloads to your computer in excel format)

  • Human - Human readable format in columns and rows

  • JSON - JSON formatted data

Defining the Data

You can pull in a variety of data metrics from the API request. You can view all available metrics and dimensions using the List Request. Simply input your API key in the key parameter field to view all reporting metrics, along with descriptions. Note that you can only request metrics from a single dimension when generating an API request.

The data parameter is formatted as a comma-separated list of Dimension.Metric arguments, outlining the metrics you'd like to view. The API request should contain only metrics from the same dimension in order to successfully generate a request.

πŸ’‘Note: The CampaignGroup dimension is the preferred format for generating campaign-level reporting.

WHERE TO GO NEXT:

Did this answer your question?