Update Essbase Script

put

/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/scripts/{scriptName}

Updates the specified script in the specified application and database and returns the updated script.

Request

Supported Media Types
Path Parameters
Query Parameters
Body ()

Script details.

Root Schema : Script
Type: object
Show Source
Back to Top

Response

200 Response

OK

Script updated successfully. Includes script details and links get, edit, or delete the script and to get its contents.

Body ()
Root Schema : Script
Type: object
Show Source

400 Response

Bad Request

Failed to update the script. The application or database name may be incorrect, the JSON for the script may be incorrect, or the specified script name may already exist.

415 Response

Not Acceptable

The media type isn't supported or wasn't specified.

500 Response

Internal Server Error.

Back to Top

Examples

The following examples shows how to update existing Essbase scripts using the REST API.

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.

Update Calculation Script

call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/dataexpoptions?links=none" -H "accept: application/json" -H "Content-Type:application/json" -d '{"name": "export_inventory", "content": "SET DATAEXPORTOPTIONS \r\n {\r\n DataExportLevel \"ALL\";\r\n DataExportColHeader \"Measures\";\r\n DataExportColFormat ON;\r\n DataExportDimHeader ON;\r\n DataExportDynamicCalc OFF;\r\n DataExportDecimal 0;\r\n DataExportDryRun OFF;\r\n DataExportOverwriteFile ON;\r\n };\r\n\r\nFIX(\"Qtr1\")\r\n DATAEXPORT \"File\" \",\" \"log.txt\" ;\r\nENDFIX;"}' -u %User%:%Password%

Example of Response Body

{
  "name" : "dataexpoptions",
  "modifiedTime" : 1721687847823,
  "sizeInBytes" : 311
}

Update MDX Script

call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/scripts/export_inventory?file=mdx&links=none" -H "accept: application/json" -H "Content-Type:application/json" -d '{"name": "grantfilter", "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]);"}' -u %User%:%Password%

Example of Response Body

{
  "name" : "export_inventory",
  "modifiedTime" : 1721686781209,
  "sizeInBytes" : 240
}

Back to Top