Skip to content

Instantly share code, notes, and snippets.

@yllus
Last active June 23, 2017 18:02
Show Gist options
  • Save yllus/3efbeba79bd078cb36108d87fee3e1c6 to your computer and use it in GitHub Desktop.
Save yllus/3efbeba79bd078cb36108d87fee3e1c6 to your computer and use it in GitHub Desktop.

The request I make is:

{
   "Version":2,
   "Type":"Program",
   "DateRanges":[
      {
         "StartDate":"2017-05-23T00:00:00Z",
         "EndDate":"2017-06-23T00:00:00Z"
      }
   ],
   "Audiences":[
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  2
               ]
            },
            {
               "Id":4,
               "Values":[
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17
               ]
            }
         ],
         "Id":41,
         "Label":"F2-17"
      },
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  2
               ]
            },
            {
               "Id":4,
               "Values":[
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
                  25,
                  26,
                  27,
                  28,
                  29,
                  30,
                  31,
                  32,
                  33,
                  34,
                  35,
                  36,
                  37,
                  38,
                  39,
                  40,
                  41,
                  42,
                  43,
                  44,
                  45,
                  46,
                  47,
                  48,
                  49
               ]
            }
         ],
         "Id":57,
         "Label":"F18-49"
      },
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  2
               ]
            },
            {
               "Id":4,
               "Values":[
                  50,
                  51,
                  52,
                  53,
                  54,
                  55,
                  56,
                  57,
                  58,
                  59,
                  60,
                  61,
                  62,
                  63,
                  64,
                  65,
                  66,
                  67,
                  68,
                  69,
                  70,
                  71,
                  72,
                  73,
                  74,
                  75,
                  76,
                  77,
                  78,
                  79
               ]
            }
         ],
         "Id":69,
         "Label":"F50+"
      },
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  1
               ]
            },
            {
               "Id":4,
               "Values":[
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17
               ]
            }
         ],
         "Id":78,
         "Label":"M2-17"
      },
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  1
               ]
            },
            {
               "Id":4,
               "Values":[
                  18,
                  19,
                  20,
                  21,
                  22,
                  23,
                  24,
                  25,
                  26,
                  27,
                  28,
                  29,
                  30,
                  31,
                  32,
                  33,
                  34,
                  35,
                  36,
                  37,
                  38,
                  39,
                  40,
                  41,
                  42,
                  43,
                  44,
                  45,
                  46,
                  47,
                  48,
                  49
               ]
            }
         ],
         "Id":94,
         "Label":"M18-49"
      },
      {
         "AttributeValues":[
            {
               "Id":2,
               "Values":[
                  1
               ]
            },
            {
               "Id":4,
               "Values":[
                  50,
                  51,
                  52,
                  53,
                  54,
                  55,
                  56,
                  57,
                  58,
                  59,
                  60,
                  61,
                  62,
                  63,
                  64,
                  65,
                  66,
                  67,
                  68,
                  69,
                  70,
                  71,
                  72,
                  73,
                  74,
                  75,
                  76,
                  77,
                  78,
                  79
               ]
            }
         ],
         "Id":106,
         "Label":"M50+"
      }
   ],
   "Stations":[
      7
   ],
   "Markets":[
      3,
      26,
      5,
      6,
      7,
      8,
      12,
      18,
      23,
      24
   ],
   "ProgramArguments":{
      "ProgramNameInclude":[
         "cfl"
      ],
      "ProgramNameExclude":[
         "documentary",
         "draft",
         "extra",
         "pregame",
         "repeat",
         "special"
      ],
      "ProgramCodeInclude":null,
      "ProgramCodeExclude":null,
      "MinimumAirings":1,
      "ProgramSliceArguments":null
   },
   "DaypartArguments":{
      "TimeType":"Station"
   },
   "RequestedStats":[
      "Rating",
      "AMA",
      "CumulativeReach",
      "CumulativeReachPercent",
      "SecondsTunedTotal",
      "LivePercent"
   ]
}

The response I get back is:

{
   "DateRanges":[
      {
         "StartDate":"2017-05-23T00:00:00Z",
         "EndDate":"2017-06-23T00:00:00Z"
      }
   ],
   "Status":"Error",
   "ErrorCode":"DateOutsideSupportedRange",
   "Messages":[
      "A requested date lies outside of the range of available dates"
   ],
   "Markets":null,
   "AudienceInformation":null,
   "Results":null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment