From fbd4cc5f4bd01cf973fa873b8e77ac9e566bffd5 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Feb 2017 20:38:55 +0200 Subject: [PATCH] docs example request test --- app/library/App/Resources/GaResource.php | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/app/library/App/Resources/GaResource.php b/app/library/App/Resources/GaResource.php index 37026bd..9994761 100644 --- a/app/library/App/Resources/GaResource.php +++ b/app/library/App/Resources/GaResource.php @@ -29,20 +29,36 @@ class GaResource extends ApiResource { ->endpoint(ApiEndpoint::get('', 'getAction') ->allow(AclRoles::USER) - ->description('Returns data from Google Analytics Api') + ->description('Returns data from Google Analytics Api. https://developers.google.com/analytics/devguides/reporting/core/dimsmets') ->exampleResponse([ - 'example' => [ - 'lifehack' => 'for example request data', - 'view_id' => 'GA VIEW_ID', - 'start' => '30daysAgo / 2015-03-01', - 'end' => 'today', - 'metric' => 'user,sessions', - 'dimension' => 'source,browser' + 'reports' => [ + 'columnHeader' => [ + 'metricHeaderEntries' => [ + 'name' => 'ga:users', + 'type' => 'INTEGER' + ] + ], + 'data' => [ + 'rows' => [ + 'metrics' => [ + 'values' => '777' + ], + ], + 'totals' => [ + 'values' => '777' + ], + 'rowCount' => '1', + 'minimums' => [ + 'values' => '777' + ], + 'maximums' => [ + 'values' => '777' + ], + ] ], - 'full_docs' => 'https://developers.google.com/analytics/devguides/reporting/core/dimsmets', ]) ->exampleRequest([ - 'example' => [ + 'get params' => [ 'view_id' => 'GA VIEW_ID', 'start' => '30daysAgo / 2015-03-01', 'end' => 'today', -- libgit2 0.21.4