The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.

Forum Discussion

dbug's avatar
dbug
New Contributor II
3 years ago
Solved

REST API Endpoint to extract data from cube view

Is there a way to extract data from a cubeview with the OneStream REST API?  I've tried using the "DataProvider/GetAdoDataSetForCubeViewCommand?api-version=5.2.0" endpoint from the doc via Python...
  • NicolasArgente's avatar
    3 years ago

    Yes. You can use that copy paste in the body of the API call.

    {
        "BaseWebServerUrl": "https://contoso.onestreamcloud.com/OneStreamWeb",
        "ApplicationName": "GolfStream_v37",
        "CubeViewName": "Gross Margin",
        "DataTablePerCubeViewRow": false,
        "ResultDataTableName": "ResultDataTableNames",
        "CustomSubstVarsAsCommaSeparatedPairs": "",
        "CubeViewDataTableOptions": {
    				"IncludeTitle": false,
    				"IncludeHeaderLeftLabel1" : true,
    				"IncludeHeaderLeftLabel2" : true,
    				"IncludeHeaderLeftLabel3" : true,
    				"IncludeHeaderLeftLabel4" : true,
    				"IncludeHeaderCenterLabel1" : true,
    				"IncludeHeaderCenterLabel2" : true,
    				"IncludeHeaderCenterLabel3" : true,
    				"IncludeHeaderCenterLabel4" : true,
    				"IncludeHeaderRightLabel1" : true,
    				"IncludeHeaderRightLabel2" : true,
    				"IncludeHeaderRightLabel3" : true,
    				"IncludeHeaderRightLabel4" : true,
    				"IncludePovCube" : true,
    				"IncludePovEntity" : true,
    				"IncludePovParent" : true,
    				"IncludePovCons" : true,
    				"IncludePovScenario" : true,
    				"IncludePovTime" : true,
    				"IncludePovView" : true,
    				"IncludePovAccount" : true,
    				"IncludePovFlow" : true,
    				"IncludePovOrigin" : true,
    				"IncludePovIC" : true,
    				"IncludePovUD1" : true,
    				"IncludePovUD2" : true,
    				"IncludePovUD3" : true,
    				"IncludePovUD4" : true,
    				"IncludePovUD5" : true,
    				"IncludePovUD6" : true,
    				"IncludePovUD7" : true,
    				"IncludePovUD8" : true,
    				"IncludeMemberDetails": true,
    				"IncludeRowNavigationLink" : true,
    				"IncludeHasDataStatus" : true,
    				"IncludeAnnotation" : true,
    				"IncludeAssumptions" : true,
    				"IncludeAuditComment" : true,
    				"IncludeFootnote" : true,
    				"IncludeVarianceExplanation" : true
    				}
    }
  • JackLacava's avatar
    JackLacava
    3 years ago

    What I meant is: check the definition of your cubeview for things like the following:

    That |WFYear| variable cannot be resolved automatically when executing the view from REST. So you have to pass the required value with the property "CustomSubstVarsAsCommaSeparatedPairs": [comma separated list of key value pairs as substitution variables with the following format: "VariableName1=[VariableValue1],VariableName2= [VariableValue2],..."]

    In addition, make sure that all dimensions have a member specified either in the main POV or in row/columns, because via REST there won't be a UserPOV to fallback on.