List or Download Files
/essbase/rest/v1/files/{path}
Returns a list of files, or downloads the specified file. To list files, use Accept='application/json'
for the Accept header. To download, use Accept='application/octet-stream'
for the Accept header.
Request
-
path(required): string
Pattern:
.+
Catalog path, starting with
applications
,shared
, orusers
. If listing files, this is the folder path. If downloading files, this is the file path.Examples:
applications/sample
shared
users/ksmith
-
action: string
Validates the upload. Supported action values are
validateUpload
and'Accept=application/json'
or'Accept=application/xml'
. -
fileSize: integer(int64)
Validates whether enough free space is available. Applicable only with query parameters
action='validateUpload'
andAccept='application/json'
orAccept='application/xml'
. -
filter: string
Filter the list of files.
-
limit: integer(int32)
Maximum number of files to return. Applicable only for listing files.
-
offset: integer(int32)
Number of items to omit from the start of the result set. Default value is 0. Applicable only for listing files.
-
overwrite: boolean
If true, overwrite files. If false, any existing file is validated but not overwritten. Applicable only with query parameters
action=validateUpload
andAccept='application/json'
orAccept='application/xml'
. Default value is false.Default Value:false
-
recursive: boolean
Recursive param to get search result as recursive.
Default Value:false
-
type: string
List files by type. If type is not specified, returns all files. Applicable only for listing files.
Response
- application/json
- application/xml
200 Response
OK
Response type can be either JSON/XML or stream, depending on the Accept header. If Accept=application/json
or Accept=application/xml
, the response lists files and current folder details. If Accept=application/octet-stream
, the response is returned as a stream. If query parameters include action=validateUpload
and Accept='application/json'
or Accept='application/xml'
, the response is empty.
object
400 Response
Bad Request
Logged in user may not have appropriate permissions, or the file may already exist when query parameters include action=validateUpload
and Accept='application/json'
or Accept='application/xml'
.
500 Response
Internal Server Error.
Examples
The following examples show how to list or download files.
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
.
Script with cURL Commands – List User Files
The following example shows how to list the files in a user directory. The listing includes links to download the files.
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1" -H "accept: application/json" -u %User%:%Password%
Example of Response Body
{
"currentFolder": {
"name": "power1",
"fullPath": "/users/power1",
"type": "folder",
"permissions": {
"addFolder": true,
"addFile": true
}
},
"items": [
{
"name": "groups.csv",
"fullPath": "/users/power1/groups.csv",
"type": "csv",
"modifiedTime": 1585088753000,
"sizeInBytes": 50,
"permissions": {
"delete": true
},
"links": [
{
"rel": "download",
"href": "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/groups.csv",
"method": "GET",
"type": "application/octet-stream"
}
]
},
{
"name": "testexamp.txt",
"fullPath": "/users/power1/testexamp.txt",
"type": "txt",
"modifiedTime": 1585088753000,
"sizeInBytes": 1074,
"permissions": {
"delete": true
},
"links": [
{
"rel": "download",
"href": "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/testexamp.txt",
"method": "GET",
"type": "application/octet-stream"
}
]
}
]
}
Script with cURL Commands – List Cube Files
The following example shows how to list only the rule files (files with type rul
) in an Essbase cube directory. Download links are suppressed.
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/applications/Sample/Basic?type=rul&links=none" -H "accept: application/json" -u %User%:%Password%
Example of Response Body
{
"currentFolder" : {
"name" : "Basic",
"fullPath" : "/applications/Sample/Basic",
"type" : "folder",
"permissions" : {
"addFile" : true
}
},
"items" : [ {
"name" : "Data.rul",
"fullPath" : "/applications/Sample/Basic/Data.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1255,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Caffeinated.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Caffeinated.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1032,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Intro_Date.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Intro_Date.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1029,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Market.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Market.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1503,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Measures.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Measures.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1896,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Ounces.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Ounces.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1017,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Pkg_Type.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Pkg_Type.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1023,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Population.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Population.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1149,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Product.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Product.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1920,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Scenario.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Scenario.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1517,
"permissions" : {
"delete" : true
}
}, {
"name" : "Dim_Year.rul",
"fullPath" : "/applications/Sample/Basic/Dim_Year.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1254,
"permissions" : {
"delete" : true
}
}, {
"name" : "oci_dblink.rul",
"fullPath" : "/applications/Sample/Basic/oci_dblink.rul",
"type" : "rul",
"modifiedTime" : 1721321442861,
"sizeInBytes" : 1000,
"permissions" : {
"delete" : true
}
} ]
}
Script with cURL Commands – Download File from User Directory
The following example shows how to download a text file from a user directory.
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/users/power1/ASO_Sample_Data.txt" -H "accept:application/octet-stream" -o ASO_Sample_Data.txt -u %User%:%Password%
Script with cURL Commands – Download File from Cube Directory
The following example shows how to download a rule file from a cube directory, overwriting in case a file of that name already has been downloaded.
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/files/applications/Sample/Basic/Data.rul?overwrite=true" -H "accept:application/octet-stream" -o Data.rul -u %User%:%Password%