Reporting REST API Documentation

ReportingDefinitionQueriesResource

Retrieves all the necessary queries and information to run a specific report.

GET

URI /services/apexrest/v1.0/definitions/*/queries
Description HTTP GET request: /services/apexrest/ffr/v1.0/definitions/{id}/queries?prompts=<json_prompts_and_values>
Rest method to get report queries from a reporting definition id and a prompt list.

Sample Code


PARAMETERS
==========

A list of prompt values that allow you to customize the report output, passed in a JSON format. You must provide at least an empty JSON list.
For example:

[ {
  "Id" : "a2a24000000B0cjAAC",
  "Value" : "Company name"
}, {
  "Id" : "a2a24000000B0ckAAC",
  "Value" : "2011/004"
} ]


REQUEST EXAMPLE: access to all fields
===============

HTTP GET request URL: /services/apexrest/ffr/v1.0/definitions/a3o580000000ec0AAA/queries?prompts=%5B%7B%22Value%22%3A%22FinancialForceUK%22%2C%22Id%22%3A%22a3v5800000003LzAAI%22%7D%5D

Raw Response
HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 11:36:58 GMT
Set-Cookie: BrowserId=XE20wzojToCqgLixHKQzSA;Path=/;Domain=.salesforce.com;Expires=Sat, 14-May-2016 11:36:58 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
Content-Encoding: gzip
Transfer-Encoding: chunked

[ {
  "Queries" : [ {
    "QueryString" : "select sum(c2g__HomeValue__c) fld_sum_A,c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c fld_10,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c fld_11 from c2g__codaTransactionLineItem__c where (c2g__OwnerCompany__r.name = 'FinancialForceUK') and (c2g__GeneralLedgerAccount__r.c2g__type__c = 'Profit and Loss') and (c2g__Transaction__r.c2g__Period__r.name = '2011/004' AND c2g__homevalue__c >= 0) group by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c order by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c",
    "FFRRow" : "Profit and Loss",
    "Columns" : {
      "fld_11" : "Trial Balance Level 3",
      "fld_10" : "Trial Balance Level 2",
      "fld_sum_A" : "Period Debits - Home Value"
    }
  }, {
    "QueryString" : "select sum(c2g__HomeValue__c) fld_sum_A,c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c fld_10,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c fld_11 from c2g__codaTransactionLineItem__c where (c2g__OwnerCompany__r.name = 'FinancialForceUK') and (c2g__GeneralLedgerAccount__r.c2g__type__c = 'Profit and Loss') and (c2g__Transaction__r.c2g__Period__r.name = '2011/004' AND c2g__homevalue__c <= 0) group by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c order by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c,c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c",
    "FFRRow" : "Profit and Loss",
    "Columns" : {
      "fld_11" : "Trial Balance Level 3",
      "fld_10" : "Trial Balance Level 2",
      "fld_sum_A" : "Period Credits - Home Value"
    }
  } ],
  "OtherColumns" : [ "Period Debits - Home Value", "Period Credits - Home Value", "Period Net - Home Value", "YTD Debits - Home Value", "YTD Credits - Home Value", "YTD Net - Home Value" ],
  "NonAccessibleFields" : { },
  "Message" : "",
  "GroupColumns" : [ "Trial Balance Level 2", "Trial Balance Level 3" ],
  "DataRange" : "DR01"
} ]


REQUEST EXAMPLE: no accessibility to some fields
===============

HTTP GET request URL: /services/apexrest/ffr/v1.0/definitions/a3o580000000ec0AAA/queries?prompts=%5B%7B%22Value%22%3A%22FinancialForceUK%22%2C%22Id%22%3A%22a3v5800000003LzAAI%22%7D%5D

Raw Response
HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 11:56:17 GMT
Set-Cookie: BrowserId=qAOM1sAhSFa3eZjZV-QSFA;Path=/;Domain=.salesforce.com;Expires=Sat, 14-May-2016 11:56:17 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
Content-Encoding: gzip
Transfer-Encoding: chunked


[ {
  "Queries" : [ {
    "QueryString" : "select sum(c2g__HomeValue__c) fld_sum_A,c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c fld_10 from c2g__codaTransactionLineItem__c where (c2g__OwnerCompany__r.name = 'FinancialForceUK') and (c2g__GeneralLedgerAccount__r.c2g__type__c = 'Profit and Loss') and (c2g__Transaction__r.c2g__Period__r.name = '2011/004' AND c2g__homevalue__c >= 0) group by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c order by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c",
    "FFRRow" : "Profit and Loss",
    "Columns" : {
      "fld_11" : "Trial Balance Level 3",
      "fld_10" : "Trial Balance Level 2",
      "fld_sum_A" : "Period Debits - Home Value"
    }
  }, {
    "QueryString" : "select sum(c2g__HomeValue__c) fld_sum_A,c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c fld_10 from c2g__codaTransactionLineItem__c where (c2g__OwnerCompany__r.name = 'FinancialForceUK') and (c2g__GeneralLedgerAccount__r.c2g__type__c = 'Profit and Loss') and (c2g__Transaction__r.c2g__Period__r.name = '2011/004' AND c2g__homevalue__c <= 0) group by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c order by c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c",
    "FFRRow" : "Profit and Loss",
    "Columns" : {
      "fld_11" : "Trial Balance Level 3",
      "fld_10" : "Trial Balance Level 2",
      "fld_sum_A" : "Period Credits - Home Value"
    }
  } ],
  "OtherColumns" : [ "Period Debits - Home Value", "Period Credits - Home Value", "Period Net - Home Value", "YTD Debits - Home Value", "YTD Credits - Home Value", "YTD Net - Home Value" ],
  "NonAccessibleFields" : {
    "c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c" : "Trial Balance Level 3"
  },
  "Message" : "Some information has been excluded from this report. Access to the following reporting values is restricted by your Salesforce object or field-level security settings: Trial Balance Level 3.",
  "GroupColumns" : [ "Trial Balance Level 2" ],
  "DataRange" : "DR01"
} ]


REQUEST EXAMPLE: no accessibility to all fields
===============

HTTP GET request URL: /services/apexrest/ffr/v1.0/definitions/a3o580000000ec0AAA/queries?prompts=%5B%7B%22Value%22%3A%22FinancialForceUK%22%2C%22Id%22%3A%22a3v5800000003LzAAI%22%7D%5D

Raw Response
HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 11:59:35 GMT
Set-Cookie: BrowserId=CufhSAG8SuGvXoBNim_qgg;Path=/;Domain=.salesforce.com;Expires=Sat, 14-May-2016 11:59:35 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
Content-Encoding: gzip
Transfer-Encoding: chunked


[ {
  "Queries" : [ ],
  "OtherColumns" : [ ],
  "NonAccessibleFields" : {
    "c2g__GeneralLedgerAccount__r.c2g__TrialBalance3__c" : "Trial Balance Level 3",
    "c2g__GeneralLedgerAccount__r.c2g__TrialBalance2__c" : "Trial Balance Level 2",
    "c2g__HomeValue__c" : "Home Value"
  },
  "Message" : "No information was returned. Your access to this data is restricted by your Salesforce object or field-level security settings.",
  "GroupColumns" : [ ],
  "DataRange" : "DR01"
} ]