Get Essbase Script Contents
/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/scripts/{scriptName}/content
Returns the contents of the specified script from the specified application and database.
Request
-
applicationName(required): string
Application name.
-
databaseName(required): string
Database name.
-
scriptName(required): string
Script name.
-
file: string
Type of script file. If omitted, the default is calc. Values can be: calc, mdx, maxl, or report.
Default Value:calc
Response
- application/json
- application/xml
200 Response
Script content retrieved successfully.
400 Response
Bad Request
Failed to get script contents. The application, database, or script name may be incorrect.
500 Response
Internal Server Error.
Examples
The following example shows how to use the Essbase REST API to get the contents of an Essbase calc script or other supported script.
This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat
.
Get Calc Script Contents
call properties.bat
curl -X GET https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/actuals/content -H "accept: application/json" -u %User%:%Password%
Example of Response Body
{
"content" : "FIX (Actual)\r\n CALC DIM(Year, Measures, Market, Product);\r\nENDFIX\r\n\r\n"
}
Get MDX Script Contents
call properties.bat
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/export_inventory/content?file=mdx" -H "accept: application/json" -u %User%:%Password%
Example of Response Body
{
"content" : "EXPORT INTO FILE \"sample_exp\" OVERWRITE\r\nSELECT \r\n {[Mar],[Apr]} \r\nON COLUMNS,\r\n Crossjoin({[New York]},\r\n Crossjoin({[Actual],[Budget]},\r\n {[Opening Inventory],[Ending Inventory]})) \r\nON ROWS\r\nFROM [Sample].[Basic]\r\nWHERE ([100-10]);"
}
Get Report Script Contents
call properties.bat
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/rowgroup/content?file=report" -H "accept: application/json" -u %User%:%Password%
Example of Response Body
{
"content" : "//Sample 4: Grouping Rows\r\n // cube: demo.basic\r\n // script: rowgroup.rep\r\n<PAGE (Accounts, Market)\r\nSales \r\n<ICHILDREN Market\r\n{ PAGEONDIMENSION Market }\r\n{ SUPMISSINGROWS }\r\n\r\n <COLUMN (Scenario)\r\n <CHILDREN Scenario\r\n\r\n<ROW(Product3, Year)\r\n<ICHILDREN Year\r\n<IDESCENDANTS Product\r\n ! \r\n"
}