kinlane
10/22/2015 - 11:48 PM

3Scale Analytics API

3Scale Analytics API

{
  "apis": [
    {
      "path": "/stats/applications/{application_id}/usage.{format}",
      "operations": [
        {
          "httpMethod": "GET",
          "summary": "Application Usage by Metric",
          "description": "Returns the usage data for a given metric (or method) of an application.",
          "group": "application_ops",
          "parameters": [
            {
              "description": "Response format.",
              "name": "format",
              "dataType": "string",
              "defaultValue": "json",
              "required": true,
              "paramType": "path",
              "allowableValues": {
                "values": [
                  "json",
                  "xml"
                ],
                "valueType": "LIST"
              }
            },
            {
              "name": "provider_key",
              "description": "Your api key with 3scale",
              "dataType": "string",
              "required": true,
              "paramType": "query",
              "threescale_name": "api_keys"
            },
            {
              "name": "application_id",
              "description": "id of the application.",
              "dataType": "int",
              "required": true,
              "paramType": "path",
              "threescale_name": "application_ids"
            },
            {
              "description": "System name of metric for which to get data.",
              "name": "metric_name",
              "dataType": "string",
              "defaultValue": "hits",
              "required": true,
              "paramType": "query",
              "threescale_name": "metric_names"
            },
            {
              "name": "since",
              "description": "Time range start. Format YYYY-MM-DD HH:MM:SS, examples: '2012-02-22', '2012-02-22 23:49:00'",
              "dataType": "string",
              "required": true,
              "paramType": "query"
            },
            {
              "name": "period",
              "description": "Period, combined with since give the stats for the time range [since .. since + period]. It is required if until is not passed.",
              "dataType": "string",
              "required": false,
              "paramType": "query",
              "defaultValue": "",
              "allowableValues": {
                "values": [
                  "year",
                  "month",
                  "week",
                  "day"
                ],
                "valueType": "LIST"
              }
            },
            {
              "name": "until",
              "description": "Time range end. Format YYYY-MM-DD HH:MM:SS",
              "dataType": "string",
              "required": false,
              "paramType": "query"
            },
            {
              "name": "granularity",
              "description": "Granularity of the results. Each period has an associated granularity.",
              "dataType": "string",
              "required": true,
              "paramType": "query",
              "defaultValue": "month",
              "allowableValues": {
                "values": [
                  "month",
                  "day",
                  "hour"
                ],
                "valueType": "LIST"
              }
            },
            {
              "description": "Timezone to do the calculations in.",
              "name": "timezone",
              "dataType": "string",
              "defaultValue": "UTC",
              "required": false,
              "paramType": "query",
              "allowableValues": {
                "values": [
                  "International Date Line West",
                  "Midway Island",
                  "American Samoa",
                  "Hawaii",
                  "Alaska",
                  "Pacific Time (US & Canada)",
                  "Tijuana",
                  "Mountain Time (US & Canada)",
                  "Arizona",
                  "Chihuahua",
                  "Mazatlan",
                  "Central Time (US & Canada)",
                  "Saskatchewan",
                  "Guadalajara",
                  "Mexico City",
                  "Monterrey",
                  "Central America",
                  "Eastern Time (US & Canada)",
                  "Indiana (East)",
                  "Bogota",
                  "Lima",
                  "Quito",
                  "Atlantic Time (Canada)",
                  "Caracas",
                  "La Paz",
                  "Santiago",
                  "Newfoundland",
                  "Brasilia",
                  "Buenos Aires",
                  "Georgetown",
                  "Greenland",
                  "Mid-Atlantic",
                  "Azores",
                  "Cape Verde Is.",
                  "Dublin",
                  "Edinburgh",
                  "Lisbon",
                  "London",
                  "Casablanca",
                  "Monrovia",
                  "UTC",
                  "Belgrade",
                  "Bratislava",
                  "Budapest",
                  "Ljubljana",
                  "Prague",
                  "Sarajevo",
                  "Skopje",
                  "Warsaw",
                  "Zagreb",
                  "Brussels",
                  "Copenhagen",
                  "Madrid",
                  "Paris",
                  "Amsterdam",
                  "Berlin",
                  "Bern",
                  "Rome",
                  "Stockholm",
                  "Vienna",
                  "West Central Africa",
                  "Bucharest",
                  "Cairo",
                  "Helsinki",
                  "Kyiv",
                  "Riga",
                  "Sofia",
                  "Tallinn",
                  "Vilnius",
                  "Athens",
                  "Istanbul",
                  "Minsk",
                  "Jerusalem",
                  "Harare",
                  "Pretoria",
                  "Moscow",
                  "St. Petersburg",
                  "Volgograd",
                  "Kuwait",
                  "Riyadh",
                  "Nairobi",
                  "Baghdad",
                  "Tehran",
                  "Abu Dhabi",
                  "Muscat",
                  "Baku",
                  "Tbilisi",
                  "Yerevan",
                  "Kabul",
                  "Ekaterinburg",
                  "Islamabad",
                  "Karachi",
                  "Tashkent",
                  "Chennai",
                  "Kolkata",
                  "Mumbai",
                  "New Delhi",
                  "Kathmandu",
                  "Astana",
                  "Dhaka",
                  "Sri Jayawardenepura",
                  "Almaty",
                  "Novosibirsk",
                  "Rangoon",
                  "Bangkok",
                  "Hanoi",
                  "Jakarta",
                  "Krasnoyarsk",
                  "Beijing",
                  "Chongqing",
                  "Hong Kong",
                  "Urumqi",
                  "Kuala Lumpur",
                  "Singapore",
                  "Taipei",
                  "Perth",
                  "Irkutsk",
                  "Ulaan Bataar",
                  "Seoul",
                  "Osaka",
                  "Sapporo",
                  "Tokyo",
                  "Yakutsk",
                  "Darwin",
                  "Adelaide",
                  "Canberra",
                  "Melbourne",
                  "Sydney",
                  "Brisbane",
                  "Hobart",
                  "Vladivostok",
                  "Guam",
                  "Port Moresby",
                  "Magadan",
                  "Solomon Is.",
                  "New Caledonia",
                  "Fiji",
                  "Kamchatka",
                  "Marshall Is.",
                  "Auckland",
                  "Wellington",
                  "Nuku'alofa",
                  "Tokelau Is.",
                  "Samoa"
                ],
                "valueType": "LIST"
              }
            },
            {
              "description": "Skip period over period calculations (defaults to true).",
              "name": "skip_change",
              "dataType": "boolean",
              "allowMultiple": "false",
              "defaultValue": "true",
              "required": false,
              "paramType": "query"
            }
          ]
        }
      ]
    },
    {
      "path": "/stats/services/{service_id}/usage.{format}",
      "operations": [
        {
          "httpMethod": "GET",
          "summary": "Service Usage by Metric",
          "description": "Returns the usage data of a given metric (or method) of a service.",
          "group": "service_ops",
          "parameters": [
            {
              "description": "Response format.",
              "name": "format",
              "dataType": "string",
              "defaultValue": "json",
              "required": true,
              "paramType": "path",
              "allowableValues": {
                "values": [
                  "json",
                  "xml"
                ],
                "valueType": "LIST"
              }
            },
            {
              "name": "provider_key",
              "description": "Your api key with 3scale",
              "dataType": "string",
              "required": true,
              "paramType": "query",
              "threescale_name": "api_keys"
            },
            {
              "name": "service_id",
              "description": "id of the service.",
              "dataType": "int",
              "required": true,
              "paramType": "path",
              "threescale_name": "service_ids"
            },
            {
              "description": "System name of metric for which to get data.",
              "name": "metric_name",
              "dataType": "string",
              "defaultValue": "hits",
              "required": true,
              "paramType": "query",
              "threescale_name": "metric_names"
            },
            {
              "name": "since",
              "description": "Time range start. Format YYYY-MM-DD HH:MM:SS, examples: '2012-02-22', '2012-02-22 23:49:00'",
              "dataType": "string",
              "required": true,
              "paramType": "query"
            },
            {
              "name": "period",
              "description": "Period, combined with since give the stats for the time range [since .. since + period]. It is required if until is not passed.",
              "dataType": "string",
              "required": false,
              "paramType": "query",
              "defaultValue": "",
              "allowableValues": {
                "values": [
                  "year",
                  "month",
                  "week",
                  "day"
                ],
                "valueType": "LIST"
              }
            },
            {
              "name": "until",
              "description": "Time range end. Format YYYY-MM-DD HH:MM:SS",
              "dataType": "string",
              "required": false,
              "paramType": "query"
            },
            {
              "name": "granularity",
              "description": "Granularity of the results. Each period has an associated granularity.",
              "dataType": "string",
              "required": true,
              "paramType": "query",
              "defaultValue": "month",
              "allowableValues": {
                "values": [
                  "month",
                  "day",
                  "hour"
                ],
                "valueType": "LIST"
              }
            },
            {
              "description": "Timezone to do the calculations in.",
              "name": "timezone",
              "dataType": "string",
              "defaultValue": "UTC",
              "required": false,
              "paramType": "query",
              "allowableValues": {
                "values": [
                  "International Date Line West",
                  "Midway Island",
                  "American Samoa",
                  "Hawaii",
                  "Alaska",
                  "Pacific Time (US & Canada)",
                  "Tijuana",
                  "Mountain Time (US & Canada)",
                  "Arizona",
                  "Chihuahua",
                  "Mazatlan",
                  "Central Time (US & Canada)",
                  "Saskatchewan",
                  "Guadalajara",
                  "Mexico City",
                  "Monterrey",
                  "Central America",
                  "Eastern Time (US & Canada)",
                  "Indiana (East)",
                  "Bogota",
                  "Lima",
                  "Quito",
                  "Atlantic Time (Canada)",
                  "Caracas",
                  "La Paz",
                  "Santiago",
                  "Newfoundland",
                  "Brasilia",
                  "Buenos Aires",
                  "Georgetown",
                  "Greenland",
                  "Mid-Atlantic",
                  "Azores",
                  "Cape Verde Is.",
                  "Dublin",
                  "Edinburgh",
                  "Lisbon",
                  "London",
                  "Casablanca",
                  "Monrovia",
                  "UTC",
                  "Belgrade",
                  "Bratislava",
                  "Budapest",
                  "Ljubljana",
                  "Prague",
                  "Sarajevo",
                  "Skopje",
                  "Warsaw",
                  "Zagreb",
                  "Brussels",
                  "Copenhagen",
                  "Madrid",
                  "Paris",
                  "Amsterdam",
                  "Berlin",
                  "Bern",
                  "Rome",
                  "Stockholm",
                  "Vienna",
                  "West Central Africa",
                  "Bucharest",
                  "Cairo",
                  "Helsinki",
                  "Kyiv",
                  "Riga",
                  "Sofia",
                  "Tallinn",
                  "Vilnius",
                  "Athens",
                  "Istanbul",
                  "Minsk",
                  "Jerusalem",
                  "Harare",
                  "Pretoria",
                  "Moscow",
                  "St. Petersburg",
                  "Volgograd",
                  "Kuwait",
                  "Riyadh",
                  "Nairobi",
                  "Baghdad",
                  "Tehran",
                  "Abu Dhabi",
                  "Muscat",
                  "Baku",
                  "Tbilisi",
                  "Yerevan",
                  "Kabul",
                  "Ekaterinburg",
                  "Islamabad",
                  "Karachi",
                  "Tashkent",
                  "Chennai",
                  "Kolkata",
                  "Mumbai",
                  "New Delhi",
                  "Kathmandu",
                  "Astana",
                  "Dhaka",
                  "Sri Jayawardenepura",
                  "Almaty",
                  "Novosibirsk",
                  "Rangoon",
                  "Bangkok",
                  "Hanoi",
                  "Jakarta",
                  "Krasnoyarsk",
                  "Beijing",
                  "Chongqing",
                  "Hong Kong",
                  "Urumqi",
                  "Kuala Lumpur",
                  "Singapore",
                  "Taipei",
                  "Perth",
                  "Irkutsk",
                  "Ulaan Bataar",
                  "Seoul",
                  "Osaka",
                  "Sapporo",
                  "Tokyo",
                  "Yakutsk",
                  "Darwin",
                  "Adelaide",
                  "Canberra",
                  "Melbourne",
                  "Sydney",
                  "Brisbane",
                  "Hobart",
                  "Vladivostok",
                  "Guam",
                  "Port Moresby",
                  "Magadan",
                  "Solomon Is.",
                  "New Caledonia",
                  "Fiji",
                  "Kamchatka",
                  "Marshall Is.",
                  "Auckland",
                  "Wellington",
                  "Nuku'alofa",
                  "Tokelau Is.",
                  "Samoa"
                ],
                "valueType": "LIST"
              }
            },
            {
              "description": "Skip period over period calculations (defaults to true).",
              "name": "skip_change",
              "dataType": "boolean",
              "allowMultiple": "false",
              "defaultValue": "true",
              "required": false,
              "paramType": "query"
            }
          ]
        }
      ]
    },
    {
      "path": "/stats/services/{service_id}/top_applications.{format}",
      "operations": [
        {
          "httpMethod": "GET",
          "summary": "Service Top Applications",
          "description": "Returns usage and application data for the top 10 most active applications of a service.",
          "group": "service_ops",
          "parameters": [
            {
              "description": "Response format.",
              "name": "format",
              "dataType": "string",
              "defaultValue": "json",
              "required": true,
              "paramType": "path",
              "allowableValues": {
                "values": [
                  "json",
                  "xml"
                ],
                "valueType": "LIST"
              }
            },
            {
              "name": "provider_key",
              "description": "Your api key with 3scale",
              "dataType": "string",
              "required": true,
              "paramType": "query",
              "threescale_name": "api_keys"
            },
            {
              "name": "service_id",
              "description": "id of the service.",
              "dataType": "int",
              "required": true,
              "paramType": "path",
              "threescale_name": "service_ids"
            },
            {
              "name": "since",
              "description": "Time range start. Format YYYY-MM-DD HH:MM:SS, examples: '2012-02-22', '2012-02-22 23:49:00'",
              "dataType": "string",
              "required": true,
              "paramType": "query"
            },
            {
              "name": "period",
              "description": "Period, combined with since give the stats for the time range [since .. since + period]. It is required if until is not passed.",
              "dataType": "string",
              "required": false,
              "paramType": "query",
              "defaultValue": "",
              "allowableValues": {
                "values": [
                  "year",
                  "month",
                  "week",
                  "day"
                ],
                "valueType": "LIST"
              }
            },
            {
              "description": "System name of metric for which to get data.",
              "name": "metric_name",
              "dataType": "string",
              "defaultValue": "hits",
              "required": true,
              "paramType": "query",
              "threescale_name": "metric_names"
            }
          ]
        }
      ]
    }
  ],
  "basePath": "",
  "swaggerVersion": "0.1a",
  "apiVersion": "1.0"
}