You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

/api/reports/views/:id/table/json

This method returns table in JSON format.

Resource Information

Request Parameters

Parameters

Detail

Example

id

ID of the table. This ID is part of the /api/reports/:id response.

123

filter

(Optional) Filter applied to the table, with following structure:

Name
Description
drilldown

Drilldown defined with attribute code and following structure:

Name
Description
opFilter operation type - please see list of supported values.
value/values(Optional) Depends on selected "op". Contains value or values for filter.


 

{
  "drilldown": {
      "L_COUNTRY_OR_AREA": { "op": "EQ", "value": "Slovakia"},
      "L_TYPE": { "op": "IN", "values": [ "Type 1", "Type 2", "Type 3" ]},
      "L_DATE":{"op":"NOT_NULL"}
  }
}

Response Structure

{ 
  "rowsCount" : ..., 
  "name" : ..., 
  "header" : [ ], 
  "body" : [ ]
}

JSON response contains elements with following definition:

NameDescription
rowsCountTotal number of rows including headers and data
nameTable view name
headerArray containing header elements
bodyArray containing data elements

Sample request/response

Using curl:

curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/1234/table/json

The JSON format response:

{ 
  "rowsCount" : 5, 
  "name" : "My Table Name", 
  "header" : [ 
    [ 
      { 
        "value" : "", 
        "type" : "header" 
      } 
    ], 
    [ 
      { 
        "value" : "", 
        "type" : "header" 
      } 
    ] 
  ], 
  "body" : [ 
    [ 
      { 
        "value" : "Value", 
        "type" : "header" 
      }, 
      { 
        "style" : " color:rgb(77, 77, 77) !important ; background-color:rgb(237, 237, 237); ", 
        "value" : "1,033,054,533,155" 
      } 
    ], 
    [ 
      { 
        "value" : "Value Footnotes", 
        "type" : "header" 
      }, 
      { 
        "style" : " color:rgb(77, 77, 77) !important ; background-color:rgb(237, 237, 237); ", 
        "value" : "1" 
      } 
    ], 
    [ 
      { 
        "value" : "B", 
        "type" : "header" 
      }, 
      { 
        "style" : " color:rgb(77, 77, 77) !important ; background-color:rgb(237, 237, 237); ", 
        "value" : "5" 
      } 
    ]
  ]
}

Next steps

  • No labels