Skip to content

List Deals and their reporting data

Request

List the Deals

This call returns all information you get with a deal and also the reporting data for a specified time interval (time_window : "yesterday", "last_7_days", "last_30_days", "month_to_date", or a custom range using "start_date" and "end_date"). You should only send time_window or start_date/end_date but not a combination of the both. The filters field allows you to filter the results based on what you need, e.g: "filters": [{"field":"id", "op":"in", "value": [123]}] will look for deals that have 123 in their ID. {"field" :"match_rate", "op":">", "value" :0} will return deals that have a "match_rate" greater than 0. You can also use the "sorting" field to sort the results, eg: "sorting":[{"field":"viewability_rate", "dir":"asc"}] will give the results sorted by the viewability_rate field.

  "reporting": {
    "organization_id": 100048,
    "time_window": "last_7_days",
    "start_date": null,
    "end_date": null
  },
  "filters": [
   {"field": "id",
               "op": "in",
               "value" : [447824]},
               {"field": "match_rate",
               "op": ">",
               "value" : 0}
  ],
  "sorting": [
      {
               "field": "viewability_rate",
               "dir": "asc"
           }
 
  ],
  "paging": {
    "page_offset": 0
  }
}
Headers
Content-Typestringrequired

Content-Type

Default:"application/json"
Cookiestringrequired

Cookie

Default:"adama_session=<<sessionid>>"
Bodyapplication/json

Request body for deal analytics query

reportingobjectrequired
filtersArray of objects

Filter criteria for deals

sortingArray of objects

Sort criteria

pagingobject
curl -i -X POST \
  https://api.mediamath.com/deals/v1.0/deal_analytics \
  -H 'Content-Type: application/json' \
  -H 'Cookie: adama_session=<<sessionid>>' \
  -d '{
    "reporting": {
      "organization_id": 0,
      "time_window": "yesterday",
      "start_date": "2019-08-24",
      "end_date": "2019-08-24"
    },
    "filters": [
      {
        "field": "string",
        "op": "string",
        "value": null
      }
    ],
    "sorting": [
      {
        "field": "string",
        "dir": "asc"
      }
    ],
    "paging": {
      "page_offset": 0,
      "page_limit": 0
    }
  }'

Responses

Returns deals with performance/reporting data

Bodyapplication/json
dataArray of objects
metaobject
Response
{ "data": [ { … } ], "meta": { "total_count": 0, "count": 0, "status": "string", "offset": 0, "next_page": "string" } }