Commit fbd4cc5f4bd01cf973fa873b8e77ac9e566bffd5

Authored by Alex Savenko
1 parent 46647ae2

docs example request test

Showing 1 changed file with 26 additions and 10 deletions   Show diff stats
app/library/App/Resources/GaResource.php
... ... @@ -29,20 +29,36 @@ class GaResource extends ApiResource {
29 29  
30 30 ->endpoint(ApiEndpoint::get('', 'getAction')
31 31 ->allow(AclRoles::USER)
32   - ->description('Returns data from Google Analytics Api')
  32 + ->description('Returns data from Google Analytics Api. https://developers.google.com/analytics/devguides/reporting/core/dimsmets')
33 33 ->exampleResponse([
34   - 'example' => [
35   - 'lifehack' => 'for example request data',
36   - 'view_id' => 'GA VIEW_ID',
37   - 'start' => '30daysAgo / 2015-03-01',
38   - 'end' => 'today',
39   - 'metric' => 'user,sessions',
40   - 'dimension' => 'source,browser'
  34 + 'reports' => [
  35 + 'columnHeader' => [
  36 + 'metricHeaderEntries' => [
  37 + 'name' => 'ga:users',
  38 + 'type' => 'INTEGER'
  39 + ]
  40 + ],
  41 + 'data' => [
  42 + 'rows' => [
  43 + 'metrics' => [
  44 + 'values' => '777'
  45 + ],
  46 + ],
  47 + 'totals' => [
  48 + 'values' => '777'
  49 + ],
  50 + 'rowCount' => '1',
  51 + 'minimums' => [
  52 + 'values' => '777'
  53 + ],
  54 + 'maximums' => [
  55 + 'values' => '777'
  56 + ],
  57 + ]
41 58 ],
42   - 'full_docs' => 'https://developers.google.com/analytics/devguides/reporting/core/dimsmets',
43 59 ])
44 60 ->exampleRequest([
45   - 'example' => [
  61 + 'get params' => [
46 62 'view_id' => 'GA VIEW_ID',
47 63 'start' => '30daysAgo / 2015-03-01',
48 64 'end' => 'today',
... ...