Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

RESTful API

Olivier Paroz edited this page Oct 19, 2015 · 7 revisions

WARNING - BETA QUALITY

This can change at any time before the official launch. Use it to test your apps and provide feedback and do contact @oparoz so that we can discuss changes

Enhancement proposal: https://github.com/owncloud/gallery/issues/408

General

  • Versioning will happen using headers
  • Authentication happens via HTTP auth
  • Root URL is https://<host>/<folder>/index.php/apps/gallery

Config API

Gives information about the supported features as well as the list of supported media types

/api/config

Parameters

  • bool extramediatypes true if the client wants previews for fonts

Files API

Gives the list of files found in the folder given as argument and lets you download a file

/api/files/list

Parameters

  • string location a path representing the current album in the app
  • string features the list of supported features
  • string etag the last known etag in the client
  • string mediatypes the list of supported media types

/api/files/download/{fileId}

Parameters

  • string|null filename an optional filename which will be added to the headers of the response

Preview API

Gives you a list of base64 encoded thumbnails when you connect to the thumbnails endpoint using EventSource and gives you a resized preview when you use the preview endpoint

/api/thumbnails

Parameters

  • string ids the ID of the files of which we need thumbnail previews of
  • bool square whether we need square previews for albums or rectangular ones for the photowall
  • double scale the scale factor to apply when asking for previews. Required for HiDPI screens

/api/preview/{fileId}/{width}/{height}

Parameters

  • int fileId the ID of the file of which we need a large preview of
  • int width
  • int height
  • bool nativesvg whether or not to send SVGs as image/svg+xml or text/plain
Clone this wiki locally