swagger: "2.0" info: title: ApigeeStats version: '0.1.0' description: |- The ApigeeStats API is exposed to provide access to Apigee Traffic Statistics. ## Supported Operations 1./queries - the ability to generate, query and retrieve results. host: api.mtn.com basePath: "/v1/trafficStats" schemes: - https securityDefinitions: ApiKeyAuth: type: "apiKey" name: "X-API-Key" in: "header" OAuth2: type: oauth2 flow: application tokenUrl: 'https://api.mtn.com/oauth/client/accesstoken?grant_type=client_credentials' security: - ApiKeyAuth: [] - OAuth2: [] consumes: - application/json produces: - application/json - application/octet-stream paths: '/queries': post: tags: - Generate report summary: Submit query to generate a report. description: >- The query will run asynchronously to produce the report output. Extract the last level of response.self as the 'queryid' > var jsonData = JSON.parse(pm.response.text()); > var lastSlashIndex = jsonData.self.lastIndexOf("/"); > var lastPart = jsonData.self.substring(lastSlashIndex + 1); > pm.environment.set("queryid", lastPart); parameters: - name: body in: body description: Request body required: true schema: $ref: '#/definitions/createReportRequest' responses: '200': description: Success schema: $ref: '#/definitions/reportCreatedResponse' '/queries/{queryid}': get: tags: - Query status summary: Retrieve the status of the submitted query. description: >- The query results are available once the status indicates 'completed' parameters: - name: queryid in: path description: queryid required: true type: string responses: '200': description: Success schema: $ref: '#/definitions/queryStatusResponse' '/queries/{queryid}/results': get: tags: - Retrieve query results summary: Retrieve the results of the completed query. description: >- The query results are returned in a ZIP file object parameters: - name: queryid in: path description: queryid required: true type: string produces: - application/octet-stream responses: '200': description: Success schema: $ref: '#/definitions/queryZIPresponse' definitions: createReportRequest: type: object properties: metrics: type: array items: $ref: '#/definitions/reportRequestMetrics' dimensions: type: string example : "apiproxy" groupByTimeUnit: type: string example: "minute" timeRange: type: string example: "last24hours" limit: type: string example: 14400 filter: type: string example: "(message_count ge 0) AND (apiproxy like 'cloud_group_prod_experiencelayer_customer%')" reportRequestMetrics: required: - name - function - alias type: object properties: name: type: string example: "message_count" function: type: string example: "sum" alias: type: string example: "sum_txn" reportCreatedResponse: required: - self - state - created type: object properties: self: type: string description: > self link has queryID as suffix example: '/organizations/mtn-prod/environments/prod/queries/305cfa6c-16a9-4820-b9f1-1c4b21692ae1' state: type: string description: Message. example: enqueued created: type: string description: date query created example: '2025-07-14T10:12:20Z' queryStatusResponse: properties: self: type: string example: '/organizations/mtn-prod/environments/prod/queries/305cfa6c-16a9-4820-b9f1-1c4b21692ae1' state: type: string description: Message. example: completed result: type: object properties: self: type: string example: "/organizations/mtn-prod/environments/prod/queries/305cfa6c-16a9-4820-b9f1-1c4b21692ae1/result" expires: type: string example: "2025-07-21T10:12:42Z" resultFileSize: type: string example: "67.43 KB" resultRows: type: string example: "9545" executionTime: type: string example: "16 seconds" created: type: string example: "2025-07-14T10:12:20Z" updated: type: string example: "2025-07-14T10:12:42Z" queryZIPresponse: type: string example: "PK..."