The /files resource accesses and controls files and file permissions. A file is stored on a volume, and contains data and visualizations for the iHub system. A unique file ID number assigned by the iHub system identifies each file. Files include report designs, raw and formatted documents, and BIRT data objects. The /files resource can also upload and download files to and from a volume.
The following sections provide an example of using each files resource as a curl command.
GET files
This example requests the list of files that are not directories in the root directory of the volume:
GET /ihub/v1/files HTTP/1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This example requests the list of files that have the extension .rptdocument within the folder with the folder ID 340000000100:
GET /ihub/v1/files?folderId=340000000100&search=*.rptdocument HTTP/1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the list of files within the folder that have the extension .rptdocument within the folder ID 340000000100 in the default volume:
This curl PUT request example changes the name and path of the file with the file ID 640000000100 to /Public/Application1/Shipped Orders.rptdesign in the default volume:
curl -i http://%RESTHost%:5010/ihub/v1/files/640000000100 ‑X PUT ‑H "AuthId:%RESTAuthId%" ‑d newName=/Public/Application1 /Shipped%20Orders.rptdesign
POST files/{fileId}/privileges
The following HTTP request changes the privileges for the file with file ID 640000000100:
POST /ihub/v1/files/6400000000100/privileges HTTP/1.1