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

This method returns table in JSON format.

Resource Information

Resource URL

https://service.belladati.com/api/reports/views/:id/table/json

HTTP Method

POST

Request Parameters

Parameters

Detail

Example

id

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

123
drilldownConfig

(Optional - RAW) Replaces the table drill-down with custom configuration. Both horizontal and vertical drill-down configurations can be replaced. Each configuration is an array with the following elements:

Name

Description

verticalDefinition of header that should be set (vertical header)
horizontalDefinition of header that should be set (horizontal header)
dataSetDrilldownAttributeCode of the attribute (e.g. L_CITY)
dataSetDrilldownAttributeSubset(Optional) ID of the used subset
hideDataSetCustomMembersDefines whether custom members will be displayed
limitSets limit for members displayed in the selected drill-down. Set this value to "ALL" if all available members should be loaded.



{
	"horizontal":[
		{
			"dataSetDrilldownAttribute":"L_PRODUCT_TYPE",
			"hideDataSetCustomMembers": false,
			"limit": "ALL"
		},
		{
			"dataSetDrilldownAttribute":"L_PRODUCT",
			"dataSetDrilldownAttributeSubset": "TdPgywXkmB",
			"hideDataSetCustomMembers": true,
			"limit": 1000
		}
	],
	"vertical":[
		{
			"dataSetDrilldownAttribute":"L_DATE",
	 		"dataSetDrilldownAttributeSubset":"0EE39yrVHY",
			"hideDataSetCustomMembers": false
		}
	]
}	


subsetValueIdIf defined, response will return value for selected member of the subset. In case, this parameter is combined with expand = true, all child of the selected member will be loaded.


subsetValueId=F2Qx2LrYRX


expandWill expand all available drill-downs. Available values: true / false


expand=true


filter

(Optional - RAW) 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.
countOp

(Optional) Used with COUNT operation. Specifies the second operation used together with count.

Supported values: EQ, NEQ, GT, GTE, LT, LTE

In order to join multiple filters or apply two filters on the same parameter, attribute drilldown can be an array. "conditionType" attribute outside "drilldown" defines condition between drilldown array members and "conditionType" attribute inside drilldown member defines condition between attributes in the drilldown.



{
   "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"
      },
      "L_PRODUCT":{
         "op":"COUNT",
         "countOp":"LTE",
         "value":"816"
      }
   }
}

Example of RAW structure

{
    "drilldownConfig": {
        "vertical": [
            {
                "dataSetDrilldownAttribute": "L_THELONGESTTITLETHERECAN01",
                "limit": "ALL",
                "hideDataSetCustomMembers": false
            },
            {
                "dataSetDrilldownAttribute": "L_THELONGESTTITLETHERECAN30",
                "limit": "ALL",
                "hideDataSetCustomMembers": false
            }
        ]
    },
    "filter": {
        "drilldown": {
            "L_THELONGESTTITLETHERECAN30": {
                "op": "EQ",
                "value": "10"
            }
        }
    }
}


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