GET /api/apis/versions/{APIVersionID}/metrics/export

Exports a summary of metric information for the specified API version, in the form of a CSV file.

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

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

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

This topic includes the following sections:

HTTP Method

GET

Back to top

URL

https://{hostname}/api/apis/versions/{APIVersionID}/metrics/export

Back to top

Sample Request

The example below shows a request for the metric information for the specified API version.

Request URL

https://{hostname}/api/apis/versions/apiversion18972.acmepaymentscorp/metrics/
export?TimeInterval=5s&Duration=1d&ReportType=service.all.operations&Environment=Sandbox

Sample request headers

GET /api/apis/versions/apiversion18972.acmepaymentscorp/metrics/
export?TimeInterval=5s&Duration=1d&ReportType=service.all.operations&Environment=Sandbox HTTP/1.1
Host: {hostname}
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
X-Csrf-Token_{tenant}: {TokenID}

Sample request body

None.

Back to top

Request Headers

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

Header Description
Accept Any format (*/*)

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
APIVersionID Path string Required The unique ID for a specific API version.
ContractID Path string Optional The unique ID for a specific contract between an app version and an API version.
AppVersionID Path string Optional The unique ID for a specific app version.
ReportType Query string Optional The type of metric information. For valid values, see Report Type.
Environment Query string Optional The environment (implementation) (Sandbox or Production). If not specified, defaults to Production.
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.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the information in an exported CSV file.

Back to top

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Date: Fri, 01 Feb 2013 15:27:26 GMT
Content-Type: text/csv
Content-Disposition: attachment;filename=export.csv

Sample response body

The response body is the export.csv file. View an example.

Back to top

Response Headers

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

Header Description
Content-Type Any format (*/*)
Content-Disposition attachment;filename=export.csv

Back to top

Response Body

Name Type Description
export.csv File attachment

A CSV file containing the exported data. It has the following columns:

  • Operation
  • Count

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.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics