From 66d82a125807f6adc7d8c3bd72b38f67a5736396 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 10 Feb 2017 17:25:39 +0200 Subject: [PATCH] doc metrics --- app/library/App/Resources/GaResource.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/app/library/App/Resources/GaResource.php b/app/library/App/Resources/GaResource.php index c5b101c..ccdd9be 100644 --- a/app/library/App/Resources/GaResource.php +++ b/app/library/App/Resources/GaResource.php @@ -28,9 +28,70 @@ class GaResource extends ApiResource { ->deny(AclRoles::UNAUTHORIZED) ->handler(GaController::class) - ->endpoint(ApiEndpoint::get('{metric}', 'getAction') + ->endpoint(ApiEndpoint::get('?{metric}', 'getAction') ->allow(AclRoles::USER) ->description('Returns data from Google Analytics Api') + ->exampleResponse(' + { + "reports": [ + { + "columnHeader": { + "metricHeader": { + "metricHeaderEntries": [ + { + "name": "users", + "type": "INTEGER" + }, + { + "name": "sessionsPerUser", + "type": "FLOAT" + } + ] + } + }, + "data": { + "rows": [ + { + "metrics": [ + { + "values": [ + "4814", + "1.23764021603656" + ] + } + ] + } + ], + "totals": [ + { + "values": [ + "4814", + "1.23764021603656" + ] + } + ], + "rowCount": 1, + "minimums": [ + { + "values": [ + "4814", + "1.23764021603656" + ] + } + ], + "maximums": [ + { + "values": [ + "4814", + "1.23764021603656" + ] + } + ] + } + } + ] + } + ') ) ; -- libgit2 0.21.4