Developer Guide: Specifying Time Periods

In this guide you will learn how to specify a time period over which a Media Strategies API task should be run.

Using the period parameter

You can specify a time period for your Media Strategies API tasks by providing the period parameter:

{
  "parameters": {
    "strategy": "...",
    "parameters": {
      "period": "7days",
      ...
    }
  },
  ...
}

The period parameter is supported for all strategies.

The default period is 28 days. The possible values for period are documented on our Common Parameters page.

If you do specify a time period, that period will be listed in the response to a GET /pylon/{service}/task/{type}/id call for that task. If a period is not specified, is omitted from the API response, and defaults to 28 days.

Time snapping

The time period over which a Media Strategies API task is run is "snapped" to the nearest complete day in the UTC/GMT timezone.

For example, if we perform a 7 day task on May 9th, 2017 at 15:05 (UTC), the query will be performed against data from May 2nd, 2017 00:00 (UTC) to May 9th, 2017 00:00 (UTC)