Examples of Get and Post Methods with Metric Types

GET Method Example

The GET /me/sport/activities/{activityId} method returns summary Metric Type data in the metricsSummary object. Below is a section of code showing summary values for the calories, fuel, distance, and steps Metric Types:
"metricSummary": {
        "calories": "0",
        "fuel": "151",
        "distance": "0.04856869950890541",
        "steps": "0",
        "duration": "0:00:40.000"
    },
The GET /me/sport/activities/{activityId} method also returns interval Metric Type data in the metrics.values array. Below is a section of code showing the values at four intervals (in this case, every 10 seconds) for the FUEL, SPEED, CALORIES, DISTANCE, and GRADE Metric Types. Notice that DISTANCE is cumulative even in interval data:
"metrics": [
        {
            "intervalMetric": 10,
            "intervalUnit": "SEC",
            "metricType": "FUEL",
            "values": [
                "3",
                "41",
                "42",
                "65"
            ]
        },
        {
            "intervalMetric": 10,
            "intervalUnit": "SEC",
            "metricType": "SPEED",
            "values": [
                "3.1666667",
                "1.9313725",
                "2.0196078",
                "2.2843137"
            ]
        },
        {
            "intervalMetric": 10,
            "intervalUnit": "SEC",
            "metricType": "CALORIES",
            "values": [
                "10",
                "14",
                "16",
                "18"
            ]
        },
        {
            "intervalMetric": 10,
            "intervalUnit": "SEC",
            "metricType": "DISTANCE",
            "values": [
                "0.0035397",
                "0.0186985",
                "0.0315418",
                "0.0485687"
            ]
        },
        {
            "intervalMetric": 10,
            "intervalUnit": "SEC",
            "metricType": "GRADE",
            "values": [
                "0.1",
                "0.9",
                "1.1",
                "1.3"
            ]
        }
    ],

POST Method Example

The POST /me/sport/activities method sends interval Metric Type data in the metrics.data object. Below is a section of code showing the values at four intervals (in this case, every 10 seconds) for the distance and speed Metric Types. Notice that distance is cumulative even in interval data:
"metrics" : {
         "data" : [
            [ 0.0035397, 3.1666667],
            [ 0.0186985, 1.9313725],
            [ 0.0315418, 2.0196078],
            [ 0.0485687, 2.2843137]
         ],
         "intervalUnit" : "sec",
         "intervalValue" : 10,
         "metricTypes" : [
            "distance",
            "speed"
         ]
      },
The POST /me/sport/activities method returns summary Metric Type data in the metricSummary object. Below is a section of code showing the values of the fuel and distance Metric Types. Note: fuel and distance are the only summary Metric Types returned with the POST method:
"metricSummary": {
            "fuel": "8",
            "distance": "0.0485687"
        }