REST API - Files

The MagicSuite API makes it possible to access the filesystem via standard OData endpoints. In addition to the basic CRUD operations, Copy and Search OData functions make the experience of interacting with the filesystem complete.

In addition to the local filesystem, it is possible to mount a SharePoint drive to ReportMagic and access its contents from Files.

Note that:

  • Requested paths must be base64 encoded
  • All Unicode characters are accepted in file and folder names except for these: ,  .. ~ " * : < > ? / | 

Downloading Binaries

Calling GET /odata/files({path}) returns metadata for the requested file or folder. Following OData conventions, changing that to GET /odata/files({path})/$value returns the contents of a file as a Stream for download (the path must point to a file, not a folder).

In the MagicSuite API, you can now also specify a fileType in the query string to immediately convert the file to the extension you prefer, for example:

GET /odata/files(base64encode(/docs/mydocument.docx))/$value?fileType=pdf

Supported file conversions are:

  • docx to docx
  • docx to pdf
  • docx to html
  • docx to png (a png of the 1st page)
  • docx to pngzip (a zip of png per page)
  • html to docx
  • pdf to png (a png of the 1st page)
  • pdf to pngzip (a zip of png per page)
An unhandled error has occurred. Reload 🗙