Skip to content

export

POST /API/v2/export
Export report data to a file of the xlsxcsv, or tsv format. Data is restricted by query parameters passed in POST arguments. See example.

Request body

  • slicer_name: the name of the report.
  • project_name: the name of the project.
  • split_by: an array of the key fields to split data by in the form of ["key_field1",...].
  • include_mappings(optional):defines whether key field value mappings are returned by the API request. The default value is 1 (mappings are returned) if only 1 key field is used in the split_by POST argument. The default value is 0 (mappings are not returned) if 2 or more key fields are used in the split_by POST argument.
  • include_total (optional): defines whether to display Total values in the exported file. Possible values: (0 - don't display Total values in the exported file, 1 - display Total values in the exported file). The default value is 0.
  • start_date, end_date: the start/end of the date range to gather data for. Supported formats:

  • timezone (optional):time zone UTC offset in hours. Format: N, where N - any integer in the range of -12 <= N <= +12.

  • export_format:target file format: xlsxcsv, or tsv.
  • filters (optional): an array with the following structure:

  • data_filters(optional): an array with the following structure:

  • filter_template(optional): a string template defining priorities for filters specified in the filters POST argument. Can contain the following elements:

  • data_filter_template(optional): a string template defining priorities for filters specified in the data_filters POST argument. Can contain the following elements:

  • order_by (optional): defines sorting rules. A single record or an array of records with the following structure:

  • data_fields (optional): the array of data fields to be returned in the form of [ "data_field1", .... ]. If it is not defined (by default), data fields will not be returned. To receive the details of all data fields available for your particular report use the info method.

  • data_field_options (optional): An array of objects used to specify additional query parameters for individual data fields. Each object supports the following structure:

Response

  • Depending on the specified value of the export_format POST argument:

    • xlsx file with exported report data (column headers and data rows). Maximum 1048570 matching data rows are exported.

    • csv file with exported report data (column headers and data rows). Maximum 1000000 matching data rows are exported. If the total number of data rows to be exported exceeds 1000000, then the Others data row is added: the summary of data rows beyond 1000000.

    • tsv file with exported report data (column headers and data rows). The escape character is "". Maximum 1000000 matching data rows are exported. If the total number of data rows to be exported exceeds 1000000, then the Others data row is added: the summary of data rows beyond 1000000.

Example

Export to CSV a Report on all Campaigns, containing the "100" string, displayed in California and Texas to users of the Opera internet browser for the period from March 01, 2012 to March 03, 2012.

Path:

https://uslicer.iponweb.com/API/v2/export

Request

{
  "slicer_name": "Traffic Demo",
  "project_name": "demo",
  "split_by": "campaign_id",
  "start_date": "2012-03-01",
  "end_date": "2012-03-03",
  "export_format": "csv",
  "filters" : [
    {
      "name": "geo_region",
      "value": [
        "California",
        "Texas"
      ],
      "match": "equals",
      "case_insensitive": 1,
      "search_mappings": 1
    },
    {
      "name": "campaign_id",
      "value": [
        "100"
      ],
      "match": "contains"
    },
    {
      "name" : "browser",
      "value": [
      "Opera"
      ],
      "match" : "equals",
      "case_insensitive": 1,
      "search_mappings": 1
    }
  ],
  "data_fields" : [
    "imps",
    "bids",
    "clicks",
    "ctr",
    "custom_column_8565"
  ]
}
curl --data '{
  "slicer_name": "Traffic Demo",
  "project_name": "demo",
  "split_by": "campaign_id",
  "start_date": "2012-03-01",
  "end_date": "2012-03-03",
  "export_format": "csv",
  "filters": [
    {
      "name": "geo_region",
      "value":[
        "California",
        "Texas"
      ],
      "match": "equals",
      "case_insensitive": 1,
      "search_mappings": 1
    },
    {
      "name": "campaign_id",
      "value" :[
        "100"
      ],
      "match": "contains"
    },
    {
      "name": "browser",
      "value":[
        "Opera"
      ],
      "match": "equals",
      "case_insensitive": 1,
      "search_mappings": 1
    }
  ],
  "data_fields":[
    "imps",
    "bids",
    "clicks",
    "ctr",
    "custom_column_8565"
  ]
}' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
"https://uslicer.iponweb.com/API/v2/export"

Response

"Campaign ID","Campaign ID Name","Impressions","Bids","Clicks","CTR","country"
"10056","",32,0,0,0,0
"10065","",1018,25280,1,0.098,0
"10072","",951,17125,0,0,0