GET /api/apps/versions/{AppVersionID}/metrics

Returns a summary of metric information for an app, in JSON format, that can be used to create a chart.

If the optional ContractID or APIVersionID are not included in the call, this operation returns metrics information for all valid API contracts for the specified app version (if the ShowSummary parameter is set to true).

For additional information regarding the set of operations dealing with metric information, see Metrics on the Platform.

Note: This operation returns metric data as a JSON object that can be used in a chart; the GET /api/apps/versions/{AppVersionID}/metrics/export operation returns the data as an exported CSV file.

Authorization Roles/Permissions: Must be logged in. Must have monitor permission for the app; an App team member, Business Admin, or API Admin for an API that the app has a contract with.

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/apps/versions/{AppVersionID}/metrics[?][ReportType={ReportType}]
&[ContractID={ContractID}]&[APIVersionID={APIVersionID}]&[Environment={Environment}]
&[StartDate={StartDate}]&[EndDate={EndDate}]&[TimeZone={TimeZone}]
&[TimeInterval={TimeInterval}]&[Duration={Duration}]&[ShowSummary={ShowSummary}]
&[ShowSLAs={ShowSLAs}]&[ShowIntervalData={ShowIntervalData}]

Back to top

Sample Request

The example below shows a request for metric information for a specific app version. The Time Interval, Duration, and Time Zone parameters are specified in the URL.

Sample request URL

Note: In the sample URL below, a line break has been added for display reasons.

https://{hostname}/api/apps/versions/7FZJvSXlIP12IHKF3DufbL1W.acmepaymentscorp/metrics?Duration=1d&Duration=1d
&Environment=Sandbox

Sample request headers

GET /api/apps/versions/7FZJvSXlIP12IHKF3DufbL1W.acmepaymentscorp/metrics?Duration=1d&Duration=1d
&Environment=Sandbox HTTP/1.1
Host: {hostname}
Accept: */*
X-Csrf-Token_acmepaymentscorp":"TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

Not applicable.

Back to top

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
AppVersionID Path string Required The unique ID for a specific app version.
ReportType Query string Optional The type of metric information. For valid values, see ReportType.
ContractID Query string Optional The unique ID for a specific contract between an app version and an API version.
ApiVersionID Query string Required The unique ID for a specific API version.
OperationName Query string Required

The specific operation for which information should be returned.

Note: Must be used in combination with the ApiVersionID parameter.

Environment Query string Optional The environment (implementation) (Sandbox or Production). If not specified, defaults to Sandbox.
StartDate Query string Optional The beginning point for the date range of metric information requested. Format: YYYY-MM-DD:THH:MM:SS. Example: StartDate=2011-01-01T11:55:22. If StartDate is not specified, the operation uses EndDate minus Duration. If both StartDate and EndDate are unspecified, the operation returns information for the Duration value, and if Duration is also unspecified it returns default Duration value of 2 hours.
EndDate Query string Optional The ending point for the date range of metric information requested. Format: YYYY-MM-DD:THH:MM:SS. Example: EndDate=2011-01-02T11:55:22. If not specified, defaults to the current date/time of the API call.
TimeZone Query string Optional The time zone for the information. If a time zone isn't specified, the information is returned in GMT. For more information, refer to Working with Time Zones and Time Intervals.
TimeInterval Query string Optional The time interval for the metric information to be returned. For example, you might want data points every 10 seconds. If not specified, defaults to five-second intervals (5s). The StartDate, EndDate, and Duration fields work together to define the information to be returned; the TimeInterval determines the data points. For more information, refer to Working with Time Zones and Time Intervals.
Duration Query string[ ] Optional The duration for the metric information. For example, you might want metric information for a 24-hour period or only for an hour. If not specified, defaults to two hours (2h). The StartDate, EndDate, and Duration fields work together to define the information to be returned.
ShowSummary Query boolean Optional Indicates whether a summary of the metric information should be included in the information returned. For example, if the metric information includes daily metrics for 7 days, the summary would include one set of totals. If not specified, this defaults to false, meaning that no summary is included.
ShowSLAs Query boolean Optional Indicates whether SLAs should be included in the information returned. If not specified, defaults to false, meaning that SLAs are not returned.
ShowIntervalData Query boolean Optional Indicates whether the metric information that's returned should be broken up by time interval. For example, if the TimeInterval value is five minutes (5m) and the Duration value is one hour (1h), and ShowIntervalData is set to true, the results would include 12 sets of information, one for each five-minute interval. Time interval data can be used to create a bar chart.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the metric information in JSON format.

Back to top

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Expires: Wed, 19 Mar 2014 13:43:25 GMT

Sample response body

{
  "StartTime" : "2014-04-16T18:29:20Z",
  "EndTime" : "2014-04-17T18:29:20Z",
  "Interval" : [ {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 283
    }, {
      "Name" : "minResponseTime",
      "Value" : 113
    }, {
      "Name" : "maxResponseTime",
      "Value" : 453
    }, {
      "Name" : "totalCount",
      "Value" : 2
    }, {
      "Name" : "successCount",
      "Value" : 2
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:53:45Z"
  }, {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 5205
    }, {
      "Name" : "minResponseTime",
      "Value" : 161
    }, {
      "Name" : "maxResponseTime",
      "Value" : 10249
    }, {
      "Name" : "totalCount",
      "Value" : 2
    }, {
      "Name" : "successCount",
      "Value" : 2
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:54:00Z"
  }, {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 2674
    }, {
      "Name" : "minResponseTime",
      "Value" : 120
    }, {
      "Name" : "maxResponseTime",
      "Value" : 10176
    }, {
      "Name" : "totalCount",
      "Value" : 4
    }, {
      "Name" : "successCount",
      "Value" : 4
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:54:10Z"
  }, {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 137
    }, {
      "Name" : "minResponseTime",
      "Value" : 116
    }, {
      "Name" : "maxResponseTime",
      "Value" : 173
    }, {
      "Name" : "totalCount",
      "Value" : 8
    }, {
      "Name" : "successCount",
      "Value" : 8
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:54:15Z"
  }, {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 186
    }, {
      "Name" : "minResponseTime",
      "Value" : 178
    }, {
      "Name" : "maxResponseTime",
      "Value" : 195
    }, {
      "Name" : "totalCount",
      "Value" : 2
    }, {
      "Name" : "successCount",
      "Value" : 2
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:54:20Z"
  }, {
    "Metric" : [ {
      "Name" : "avgResponseTime",
      "Value" : 164
    }, {
      "Name" : "minResponseTime",
      "Value" : 161
    }, {
      "Name" : "maxResponseTime",
      "Value" : 168
    }, {
      "Name" : "totalCount",
      "Value" : 3
    }, {
      "Name" : "successCount",
      "Value" : 3
    }, {
      "Name" : "faultCount",
      "Value" : 0
    } ],
    "StartTime" : "2014-04-17T17:54:30Z"
  } ]
}

Back to top

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

Back to top

Response Body

Name Type Description
Graph Graph Contains metric information.

Back to top

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics