Skip to content

ADR01 - Create a report request

Request

Description

Create a report request to generate a report. Supports multiple report types such as PRODUCT, KEYWORD, INVENTORY, DISPLAY, LEFTOVER_OFFSITE_GOOGLE_SHOPPING.

Bodyapplication/json
columnsArray of strings

The list of columns to be used for report. The availability of columns depends on the selection of report attribute. Cannot be used with preview:true

filtersobject

The filters to apply to the report, provided as a map of filter name to value. A filter value must be a string or a list of strings. The list of available filters depends on the selected report type (see below). Date filters (start_date, end_date) must use the ISO date format yyyy-MM-dd. Cannot be used with preview:true.

Available filters by report type:

  • PRODUCT: start_date, end_date, publisher_group_id, publisher_group_name, publisher_id, publisher_name, target_id, target_type, target_name, target_mmp_shop_id, creator_type, campaign_id, campaign_name, adgroup_id, adgroup_name, sku, product_sku, product_name, product_category_id, product_category_name, product_master_fw_id, impression_category_id, impression_category_name, brand
  • KEYWORD: start_date, end_date, publisher_group_id, publisher_group_name, publisher_id, publisher_name, target_id, target_type, target_name, target_mmp_shop_id, creator_type, campaign_id, campaign_name, adgroup_id, adgroup_name, search_term
  • INVENTORY: start_date, end_date, publisher_group_id, publisher_group_name, publisher_id, publisher_name, page_id, page_type, page_name, ad_unit_id, ad_unit_name, impression_category_id, impression_category_name
  • DISPLAY: start_date, end_date, publisher_group_id, publisher_group_name, publisher_id, publisher_name, target_id, target_type, target_name, target_mmp_shop_id, creator_type, campaign_id, campaign_name, adgroup_id, adgroup_name, impression_category_id, impression_category_name, creative_set_id, creative_set_name, asset_name, asset_size
formatstring

The report file format

Enum: "CSV"

previewboolean

If true, generates the first 100 rows of the requested report, all columns included

reportstringrequired

The type of report to be generated.

Enum: "PRODUCT", "KEYWORD", "INVENTORY", "DISPLAY", "LEFTOVER_OFFSITE_GOOGLE_SHOPPING"

curl -i -X POST \
  https://retailmedia.mirakl.net/api/reports \
  -H 'Content-Type: application/json' \
  -d '{
    "columns": [
      "date",
      "publisher_id",
      "publisher_name",
      "publisher_group_id",
      "sku"
    ],
    "filters": {
      "adgroup_id": [
        "6f7a8b9c-0d1e-4f2a-3b4c-5d6e7f8a9b0c"
      ],
      "adgroup_name": [
        "Ad Group 1"
      ],
      "brand": [
        "Brand 1",
        "Brand 2"
      ],
      "campaign_id": [
        "4d5e6f7a-8b9c-4d0e-1f2a-3b4c5d6e7f8a",
        "5e6f7a8b-9c0d-5e1f-2a3b-4c5d6e7f8a9b"
      ],
      "campaign_name": [
        "Campaign 1"
      ],
      "creator_type": [
        "SELLER"
      ],
      "end_date": "2024-01-31",
      "impression_category_id": [
        "impression-category-1"
      ],
      "impression_category_name": [
        "Impression Category 1"
      ],
      "product_category_id": [
        "category-1"
      ],
      "product_category_name": [
        "Category 1"
      ],
      "product_master_fw_id": [
        "master-fw-1"
      ],
      "product_name": [
        "Product 1"
      ],
      "product_sku": [
        "product-sku-1"
      ],
      "publisher_group_id": [
        "7b5f3c2a-1d4e-4a8b-9c6d-2e1f0a3b4c5d",
        "8c6e4d3b-2e5f-5b9c-0d7e-3f2a1b4c5d6e"
      ],
      "publisher_group_name": [
        "Publisher Group 1",
        "Publisher Group 2"
      ],
      "publisher_id": [
        "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
        "2b3c4d5e-6f7a-5b8c-9d0e-1f2a3b4c5d6e"
      ],
      "publisher_name": [
        "publisher1",
        "publisher2"
      ],
      "sku": [
        "sku-1",
        "sku-2"
      ],
      "start_date": "2024-01-01",
      "target_id": [
        "3c4d5e6f-7a8b-4c9d-0e1f-2a3b4c5d6e7f"
      ],
      "target_mmp_shop_id": [
        "shop-1"
      ],
      "target_name": [
        "Target 1"
      ],
      "target_type": [
        "SELLER"
      ]
    },
    "format": "CSV",
    "preview": false,
    "report": "PRODUCT"
  }'

Responses

OK

Bodyapplication/json
report_idstring

The id of report returned by ADR01 and used to check the report status (ADRO2) or to download the report (ADR03)

Response
{ "reportId": "report_id_returned" }