{
  "swagger": "2.0",
  "info": {
    "version": "v1",
    "title": "Reporting API Guide"
  },
  "basePath": "/api/endpoint-management/report",
  "host": "{customerid}.xm.cloud.com:4443",
  "schemes": [
      "https"
  ],
  "tags": [
      {
          "name": "reporting-controller",
          "description": "Reporting controller"
      }
  ],
  "paths": {
    "/$search": {
      "post": {
        "tags": [
          "reporting-controller"
        ],
        "summary": "Create reports by submitting a JSON template with a search criteria",
        "description": "Available segments: applications, devices, users, enrollments, softwareInventories",
        "operationId": "searchReport",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json",
          "text/csv"
        ],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "description": "Content type and charset accepted by the client. Currently, the API only supports application/json (type) and utf-8 (charset).",
            "required": true,
            "type": "string",
            "default": "application/json"
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "CC Bearer Token.",
            "required": true,
            "type": "string",
            "default": "CWSAuth bearer=<CC Bearer Token>"
          },
          {
            "name": "Citrix-TransactionId",
            "in": "header",
            "description": "Citrix Transaction ID uniquely identifies/traces service-service interactions.",
            "required": false,
            "type": "string"
          },
          {
            "in": "body",
            "name": "model",
            "description": "model",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ReportQueryApiModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Citrix-Continuation-Token": {
                "type": "string"
              },
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Location": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/Report"
            }
          },
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "404": {
            "description": "Not Found"
          },
          "406": {
            "description": "Not Acceptable",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "Retry-After": {
                "type": "integer",
                "format": "int32"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          }
        }
      }
    },
    "/{segment}": {
      "get": {
        "tags": [
          "reporting-controller"
        ],
        "summary": "Generates report",
        "description": "Generates report",
        "operationId": "getReport",
        "produces": [
          "application/json",
          "text/csv"
        ],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "description": "Content type and charset accepted by the client. Currently, the API only supports application/json (type) and utf-8 (charset).",
            "required": true,
            "type": "string",
            "default": "application/json"
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "CC Bearer Token.",
            "required": true,
            "type": "string",
            "default": "CWSAuth bearer=<CC Bearer Token>"
          },
          {
            "name": "Citrix-TransactionId",
            "in": "header",
            "description": "Citrix Transaction ID uniquely identifies/traces service-service interactions.",
            "required": false,
            "type": "string"
          },
          {
            "name": "i",
            "in": "query",
            "description": "JSON formatted array of column names to include from the final output. In queries involving multiple segments, these fields need to be properly qualified using the recommended dot-separated (U+002E FULL-STOP, “.”) field syntax.",
            "required": false,
            "type": "string"
          },
          {
            "name": "j",
            "in": "query",
            "description": "These are additional segments to join into the main segment. At least, one of: devices,applications,users,enrollments,softwareInventories (not equal to SEGMENT).",
            "required": false,
            "type": "string"
          },
          {
            "name": "l",
            "in": "query",
            "description": "Numerical value < [Max Result Set]",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "segment",
            "in": "path",
            "description": "Main segment to query for.  One of: devices,applications,users,enrollments,softwareInventories",
            "required": true,
            "type": "string"
          },
          {
            "name": "x",
            "in": "query",
            "description": "JSON formatted array of column names to exclude from the final output. In queries involving multiple segments, these fields need to be properly qualified using the recommended dot-separated (U+002E FULL-STOP, “.”) field syntax.",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Citrix-Continuation-Token": {
                "type": "string"
              },
              "Citrix-TransactionId": {
                "type": "string"
              },
              "Cache-Control": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Vary": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/Report"
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "406": {
            "description": "Not Acceptable",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "Retry-After": {
                "type": "integer",
                "format": "int32"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "Citrix-TransactionId": {
                "type": "string"
              },
              "X-Content-Type-Options": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              }
            },
            "schema": {
              "$ref": "#/definitions/ApiErrorResponsePayload"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Timestamp": {
      "type": "object",
      "properties": {
        "date": {
          "type": "integer",
          "format": "int32"
        },
        "day": {
          "type": "integer",
          "format": "int32"
        },
        "hours": {
          "type": "integer",
          "format": "int32"
        },
        "minutes": {
          "type": "integer",
          "format": "int32"
        },
        "month": {
          "type": "integer",
          "format": "int32"
        },
        "nanos": {
          "type": "integer",
          "format": "int32"
        },
        "seconds": {
          "type": "integer",
          "format": "int32"
        },
        "time": {
          "type": "integer",
          "format": "int64"
        },
        "timezoneOffset": {
          "type": "integer",
          "format": "int32"
        },
        "year": {
          "type": "integer",
          "format": "int32"
        }
      },
      "title": "Timestamp"
    },
    "ApiErrorResponseParameter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "title": "ApiErrorResponseParameter"
    },
    "ReportingTuple": {
      "type": "object",
      "title": "ReportingTuple"
    },
    "Report": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReportingTuple"
          }
        }
      },
      "title": "Report"
    },
    "ApiErrorResponsePayload": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string"
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ApiErrorResponseParameter"
          }
        },
        "type": {
          "type": "string"
        }
      },
      "title": "ApiErrorResponsePayload"
    },
    "FilterApiModel": {
      "type": "object",
      "properties": {
        "$eq": {
          "type": "object",
          "description": "$eq"
        },
        "$ge": {
          "type": "object",
          "description": "$ge"
        },
        "$gt": {
          "type": "object",
          "description": "$gt"
        },
        "$in": {
          "type": "array",
          "description": "$in",
          "items": {
            "type": "object"
          }
        },
        "$le": {
          "type": "object",
          "description": "$le"
        },
        "$lt": {
          "type": "object",
          "description": "$lt"
        },
        "$ne": {
          "type": "object",
          "description": "$ne"
        },
        "$nin": {
          "type": "array",
          "description": "$nin",
          "items": {
            "type": "object"
          }
        },
        "$nsw": {
          "type": "string",
          "description": "$nsw"
        },
        "$sw": {
          "type": "string",
          "description": "$sw"
        }
      },
      "title": "FilterApiModel",
      "description": "Filter Model"
    },
    "ReportQueryApiModel": {
      "type": "object",
      "required": [
        "segment"
      ],
      "properties": {
        "excludes": {
          "type": "array",
          "example": [
            "devices.wifiMacAddress"
          ],
          "description": "Excludes",
          "items": {
            "type": "string"
          }
        },
        "filter": {
          "type": "object",
          "example": {
            "devices.deviceType": {
              "$eq": "iPhone"
            }
          },
          "description": "Filters",
          "additionalProperties": {
            "$ref": "#/definitions/FilterApiModel"
          }
        },
        "includes": {
          "type": "array",
          "example": [
            "softwareinventories.hasUpdateAvailable",
            "devices.model",
            "devices.deviceType"
          ],
          "description": "Includes",
          "items": {
            "type": "string"
          }
        },
        "joins": {
          "type": "array",
          "example": [
            "applications",
            "softwareinventories"
          ],
          "description": "Joins",
          "items": {
            "type": "string"
          }
        },
        "limit": {
          "type": "integer",
          "format": "int32",
          "example": 100,
          "description": "Limit"
        },
        "order": {
          "type": "object",
          "example": {
            "applications.category": "$asc"
          },
          "description": "Orders",
          "additionalProperties": {
            "type": "string"
          }
        },
        "segment": {
          "type": "string",
          "example": "devices",
          "description": "Segment"
        }
      },
      "title": "ReportQueryApiModel",
      "description": "Report Request Model"
    }
  },
  "securityDefinitions": {
    "APIKeyHeader": {
      "type": "apiKey",
      "in": "header",
      "name": "auth_token"
    }
  },
  "security": [
    {
      "APIKeyHeader": []
    }
  ]
}