API ReferenceAnnouncementsCommunity Discussion
API ReferenceCommunity DiscussionAnnouncementsSubscribeLog In
API Reference

Some examples

🚧

The following examples demonstrate the basic usage of the API.

Make sure to read the specific guidelines for each dimension and filter - see Dimensions Cheat Sheet and Filters.

Example 1 -by_hour dimension

GET /backstage/api/1.0/<<example_advertiser_id>>/reports/realtime-campaign-summary/dimensions/by_hour?start_date=2023-03-28T00:00:00&end_date=2023-03-28T23:59:59 HTTP/1.1
Host: backstage.taboola.com
Authorization: Bearer {access-token}
{
  "timezone": "EDT",
  "results": [
    {
      "date": "2023-03-28 02:00:00.0",
      "clicks": 0,
      "visible_impressions": 5,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    },
    {
      "date": "2023-03-28 01:00:00.0",
      "clicks": 0,
      "visible_impressions": 18,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    },
    {
      "date": "2023-03-28 00:00:00.0",
      "clicks": 0,
      "visible_impressions": 8,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    }
  ],
  "recordCount": 3,
  "metadata": {
    "total": 3,
    "count": 3,
    "static_fields": [
      {
        "id": "date",
        "format": null,
        "data_type": "DATE"
      },
      {
        "id": "clicks",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "visible_impressions",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "spent",
        "format": null,
        "data_type": "MONEY"
      },
      {
        "id": "cpa_actions_num",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "conversions_value",
        "format": ".2f",
        "data_type": "MONEY"
      },
      {
        "id": "roas",
        "format": ".2f",
        "data_type": "PERCENT"
      },
      {
        "id": "vctr",
        "format": null,
        "data_type": "PERCENT"
      },
      {
        "id": "vcpm",
        "format": null,
        "data_type": "MONEY"
      },
      {
        "id": "cpc",
        "format": ".3f",
        "data_type": "MONEY"
      },
      {
        "id": "cpa",
        "format": ".3f",
        "data_type": "MONEY"
      },
      {
        "id": "cpa_conversion_rate",
        "format": null,
        "data_type": "PERCENT"
      }
    ]
  }
}

Example 2 - by_smallest_time_bucket dimension

GET /backstage/api/1.0/<<example_advertiser_id>>/reports/realtime-campaign-summary/dimensions/by_smallest_time_bucket?start_date=2023-03-28T00:00:00&end_date=2023-03-28T23:59:59
 HTTP/1.1
Host: backstage.taboola.com
Authorization: Bearer {access-token}
{
  "timezone": "EDT",
  "results": [
    {
      "date": "2023-03-28 02:10:00.0",
      "clicks": 0,
      "visible_impressions": 2,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    },
    {
      "date": "2023-03-28 02:05:00.0",
      "clicks": 0,
      "visible_impressions": 2,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    },
    {
      "date": "2023-03-28 02:00:00.0",
      "clicks": 0,
      "visible_impressions": 3,
      "spent": 0,
      "cpa_actions_num": 0,
      "conversions_value": 0,
      "roas": 0,
      "vctr": 0,
      "vcpm": 0,
      "cpc": 0,
      "cpa": 0,
      "cpa_conversion_rate": 0
    }
  ],
  "recordCount": 3,
  "metadata": {
    "total": 3,
    "count": 3,
    "static_fields": [
      {
        "id": "date",
        "format": null,
        "data_type": "DATE"
      },
      {
        "id": "clicks",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "visible_impressions",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "spent",
        "format": null,
        "data_type": "MONEY"
      },
      {
        "id": "cpa_actions_num",
        "format": null,
        "data_type": "NUMERIC"
      },
      {
        "id": "conversions_value",
        "format": ".2f",
        "data_type": "MONEY"
      },
      {
        "id": "roas",
        "format": ".2f",
        "data_type": "PERCENT"
      },
      {
        "id": "vctr",
        "format": null,
        "data_type": "PERCENT"
      },
      {
        "id": "vcpm",
        "format": null,
        "data_type": "MONEY"
      },
      {
        "id": "cpc",
        "format": ".3f",
        "data_type": "MONEY"
      },
      {
        "id": "cpa",
        "format": ".3f",
        "data_type": "MONEY"
      },
      {
        "id": "cpa_conversion_rate",
        "format": null,
        "data_type": "PERCENT"
      }
    ]
  }
}

Sample error responses

{
  "http_status": 400,
  "message": "Requested interval [24 hours] exceeds the max interval for this context [1 hours]",
  "message_code": "api.action.bad_request.null"
}