SparkPost.GetTable

Updated on

SparkPost.GetTable is a Power Query M function that returns a table of available metrics from the SparkPost API v1.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

SparkPost.GetTable(
   DaysToAggregate as number,
   MetricColumns as text,
   NonMetricColumns as text,
   Path as text,
) as table

Description

This function can be used to retrieve data from a particular “Metrics” endpoint of the SparkPost API v1. When refreshing these tables or making calls to the SparkPost API using this connector, keep in mind that the SparkPost API has a strict API rate limit. If you see a 429 status code being returned from the SparkPost server you have hit the rate limit and will need to wait a few moments before making more calls. When choosing a value for the Number of days parameter, note that the API only stores 6 months worth of data.

Examples

Retrieves count_sent and count_rejected deliverability metrics for all campaign_ids aggregated over the last three days.

// Output: table
Source = SparkPost.GetTable( 3, "count_sent,count_rejected", "campaign_id", "metrics/deliverability/campaign" )

Other functions related to SparkPost.GetTable are:

Contribute » | Contributors: Rick de Groot