edit-icon download-icon

Query the error metric data of an API

Last Updated: May 17, 2017

Description

For querying the error metric data of a specified API.

  • This function is intended for API activators.
  • This interface is used to query the statistics on failed calls in the monitoring data of a specified API.
  • By default, statistics is collected by the monitoring function only on the APIs in the product stage excluding the API calls in the test stage.

Request parameters

Name Type Required? Description
Action String Yes Operation interface, which is a required parameter; value: DescribeApiErrorData.
GroupId String No ID of the group.
ApiId String Yes ID of the API.
StartTime String Yes Start time, which follows the ISO8601 standard and uses UTC time. The format is YYYY-MM-DDThh:mm:ssZ.
EndTime String Yes End time, which follows the ISO8601 standard and uses UTC time. The format is YYYY-MM-DDThh:mm:ssZ.

Return parameters

Name Type Description
ClientErrors MonitorItem Returned metric information about API call failure (due to client reasons), in a format consisting of MonitorItem.
All calls for which the HTTP status code returned to the callers is 4XX are all included in failed calls due to the client reasons.
ServerErrors MonitorItem Returned metric information about API call failure (due to server reasons), in a format consisting of MonitorItem.
All calls for which the HTTP status code returned to the callers is 5XX are all included in failed calls due to the server reasons.

Examples

Request example

  1. https://apigateway.cn-qingdao.aliyuncs.com/?Action=DescribeApiErrorData
  2. &GroupId=63be9002440b4778a61122f14c2b2bbb
  3. &ApiId=d6f679aeb3be4b91b3688e887ca1fe16
  4. &StartTime=2016-07-23T08:28:48Z
  5. &EndTime=2016-07-23T09:28:48Z
  6. &<Public request parameters>

Response example

XML format

  1. <DescribeApiErrorDataResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BZ001</RequestId>
  3. <ClientErrors>
  4. <MonitorItem>
  5. <ItemTime>2016-07-28T08:20:00Z</ItemTime>
  6. <ItemValue>2</ItemValue>
  7. </MonitorItem>
  8. <MonitorItem>
  9. <ItemTime>2016-07-28T08:22:00Z</ItemTime>
  10. <ItemValue>5</ItemValue>
  11. </MonitorItem>
  12. <MonitorItem>
  13. <ItemTime>2016-07-28T08:24:00Z</ItemTime>
  14. <ItemValue>6</ItemValue>
  15. </MonitorItem>
  16. </ClientErrors>
  17. <ServerErrors>
  18. <MonitorItem>
  19. <ItemTime>2016-07-28T08:20:00Z</ItemTime>
  20. <ItemValue>0</ItemValue>
  21. </MonitorItem>
  22. <MonitorItem>
  23. <ItemTime>2016-07-28T08:22:00Z</ItemTime>
  24. <ItemValue>1</ItemValue>
  25. </MonitorItem>
  26. <MonitorItem>
  27. <ItemTime>2016-07-28T08:24:00Z</ItemTime>
  28. <ItemValue>1</ItemValue>
  29. </MonitorItem>
  30. </ServerErrors>
  31. </DescribeApiErrorDataResponse>

JSON format

  1. {
  2. "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BZ001",
  3. "ClientErrors": {
  4. "MonitorItem": [
  5. {
  6. "ItemTime": "2016-07-28T08:20:00Z",
  7. "ItemValue": "2"
  8. },
  9. {
  10. "ItemTime": "2016-07-28T08:22:00Z",
  11. "ItemValue": "5"
  12. },
  13. {
  14. "ItemTime": "2016-07-28T08:24:00Z",
  15. "ItemValue": "6"
  16. }
  17. ]
  18. },
  19. "ServerErrors": {
  20. "MonitorItem": [
  21. {
  22. "ItemTime": "2016-07-28T08:20:00Z",
  23. "ItemValue": "0"
  24. },
  25. {
  26. "ItemTime": "2016-07-28T08:22:00Z",
  27. "ItemValue": "1"
  28. },
  29. {
  30. "ItemTime": "2016-07-28T08:24:00Z",
  31. "ItemValue": "1"
  32. }
  33. ]
  34. }
  35. }
Thank you! We've received your feedback.