{"__v":1,"_id":"562911bc3398070d002f30e8","category":{"__v":0,"_id":"56394f791593e4190073a44b","pages":[],"project":"5553d36165e8260d0024419a","version":"55fc9b793c21291900e7e0d7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-04T00:21:13.911Z","from_sync":false,"order":15,"slug":"api-api-call-statistics","title":"API: API Call Statistics"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"5553d36165e8260d0024419a","user":"5553d33065e8260d00244199","version":{"__v":12,"_id":"55fc9b793c21291900e7e0d7","project":"5553d36165e8260d0024419a","createdAt":"2015-09-18T23:17:13.545Z","releaseDate":"2015-09-18T23:17:13.545Z","categories":["55fc9b7a3c21291900e7e0d8","55fc9b7a3c21291900e7e0d9","55fc9b7a3c21291900e7e0da","55fc9b7a3c21291900e7e0db","55fc9b7a3c21291900e7e0dc","55fc9b7a3c21291900e7e0dd","55fc9b7a3c21291900e7e0de","55fc9b7a3c21291900e7e0df","55fc9b7a3c21291900e7e0e0","55fc9b7a3c21291900e7e0e1","55fc9b7a3c21291900e7e0e2","55fc9b7a3c21291900e7e0e3","55fc9bad4c80910d00b9bece","56394a0c3539050d00082122","56394a2f68b11f0d0048c9ff","56394a462fc5520d001a4db3","56394a4c2fc5520d001a4db4","56394a5b049e420d00476b5c","56394a6a2fc5520d001a4db5","56394f791593e4190073a44b","567b3adfb56bac0d0019d8d9","569d590e5a2b060d008741eb","569ea93dffccd10d00a05c7f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-22T16:41:32.329Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"","language":"json"}]},"method":"get","results":{"codes":[{"name":"","code":"{\n  \"meta\": {\n    \"kind\": \"MONTH\", \n    \"call_id\": \"agxkZXZ-dmlhdGVzdHNyFwsSClRlc3RTZXR1cDIYgICAgKDDxwgM\", \n    \"type\": \"ALL\", \n    \"max_time\": \"2015-10-01T00:00:00Z\", \n    \"next_cursor\": null, \n    \"location_id\": \"\", \n    \"name\": \"API test name\", \n    \"more\": false, \n    \"min_time\": \"2015-10-01T00:00:00Z\"\n  }, \n  \"stats\": [\n    {\n      \"avg_latency\": 383.5, \n      \"max_latency\": 749, \n      \"time\": \"2015-10-01T00:00:00Z\", \n      \"count\": 20\n    },\n    ...\n  ]\n}","language":"json","status":200},{"name":"","code":"{\n  \"error_msg\": \"Additional properties are not allowed (u'id' was unexpected)\", \n  \"error\": 400\n}","language":"json","status":400}]},"settings":"","auth":"required","params":[{"_id":"55fca80e3734100d00a9880c","ref":"","in":"path","required":true,"desc":"ID string of API Call you're updating","default":"","type":"string","name":"id"},{"_id":"5629115d2c0fd9190067da3a","ref":"","in":"query","required":false,"desc":"Granularity of data required, one of DAY, WEEK, MONTH, YEAR.","default":"DAY","type":"string","name":"kind"},{"_id":"5629115d2c0fd9190067da39","ref":"","in":"query","required":false,"desc":"ISO formatted date string for the start of the period you wish to view.","default":"(current time)","type":"datetime","name":"time"},{"_id":"5629115d2c0fd9190067da38","ref":"","in":"query","required":false,"desc":"Return stats for all calls in the time period specified which had this result.","default":"ALL","type":"string","name":"type"},{"_id":"5629115d2c0fd9190067da37","ref":"","in":"query","required":false,"desc":"Location where the API Call was made.","default":"","type":"string","name":"location_id"},{"_id":"562912b55cfea90d00ddc6e7","ref":"","in":"query","required":false,"desc":"Maximum number of results to return","default":"500","type":"int","name":"limit"}],"url":"/calls/:id/stats/since"},"isReference":false,"order":3,"body":"The JSON schema for the output is available at ./schema.json\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import APImetrics\\n\\nobj_id = \\\"ID_OF_OBJECT\\\"\\n\\napimetrics = APImetrics.APImetricsAPI(apimetrics_key=\\\"your_api_key\\\")\\nresp = apimetrics.run_call(obj_id, {})\\nprint result['result_id']\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]","excerpt":"Use this API to extract the statistics for a period of time.","slug":"callsidstatssince","type":"endpoint","title":"List Stats since a date for an API Call"}

getList Stats since a date for an API Call

Use this API to extract the statistics for a period of time.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
ID string of API Call you're updating

Query Params

kind:
stringDAY
Granularity of data required, one of DAY, WEEK, MONTH, YEAR.
time:
datetime(current time)
ISO formatted date string for the start of the period you wish to view.
type:
stringALL
Return stats for all calls in the time period specified which had this result.
location_id:
string
Location where the API Call was made.
limit:
integer500
Maximum number of results to return

Result Format


Documentation

The JSON schema for the output is available at ./schema.json [block:code] { "codes": [ { "code": "import APImetrics\n\nobj_id = \"ID_OF_OBJECT\"\n\napimetrics = APImetrics.APImetricsAPI(apimetrics_key=\"your_api_key\")\nresp = apimetrics.run_call(obj_id, {})\nprint result['result_id']", "language": "python" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}