Skip to content

microsoft_export

POST /API/v2/microsoft_export

Exports report data to Microsoft OneDrive. 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.
  • add_keys : the array of key fields to add. Format: ["key_field1", ... ].
  • email: an array of 1 - 20 email addresses in the form of ["email_address1",...].
  • 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.

  • 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:

  • drive_folder (optional): Any folder in your Google Drive. Could be a shared folder as well. You can also use subfolders, e.g: Folder/SubFolder/SubSubFolder. Might be left empty.

  • drive_file_name: Any filename supported by Microsoft OneDrive. It is expected that filename ends with .xlsx.
  • can_write : Gives edit rights for users that you share the file with. Possible values: true and false. The default value is true.

Response

  • Microsoft OneDrive file: a file with exported report data (column headers and data rows). Maximum 1048570 data rows.

Example

Export to Microsoft OneDrive 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/microsoft_export

Request

{
"slicer_name": "Traffic Demo",
"project_name": "demo",
"split_by": "campaign_id",
"start_date": "2011-02-16",
"end_date": "2011-02-18",
"email": [
  "jsmith@gmail.com"
  ]
"filters" : [
      {
        "name": "geo_region",
        "value": [
          "California",
          "Texas"
        ],
        "match": "equals"
      },
      {
        "name": "campaign_id",
        "value": [
            "100"
        ],
        "match": "contains"
      },
      {
        "name" : "browser",
        "value": [
            "Opera"
        ],
        "match" : "equals"
      }
  ]
}
curl --data '{
  "slicer_name": "Traffic Demo",
  "project_name": "demo",
  "split_by": "campaign_id",
  "start_date": "2012-03-01",
  "end_date": "2012-03-03", 
  "email": [
    "jsmith@gmail.com"
  ],
  "filters": [
    {
      "name": "geo_region", 
      "value":[
        "California",
        "Texas"
      ],
      "match": "equals"
    },
    {
      "name": "campaign_id",
      "value" :[
        "100"
      ],
      "match": "contains"
    },
    {
      "name": "browser", 
      "value":[
        "Opera"
      ], 
      "match": "equals"
    } 
  ], "drive_folder": "uSlicer export/",

   "drive_filename": "1.xslx" 
   }' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  "https://uslicer.iponweb.com/API/v2/microsoft_export"

Response

{
  "status" : "success"
}