Skip to content

mainio/decidim-module-apifiles

Repository files navigation

Decidim::Apifiles

This module adds capabilities to the Decidim API to upload and manage file blobs that can be attached to different API objects through mutations.

Usage

This is a backend development module aimed for developers. There is no user interface or other functionality provided by this module.

The module provides a new API endpoint /api/blobs which can be used to upload new file blobs to Decidim. These blobs can be then attached to different API objects through mutations.

The blobs have to be uploaded as signed in. Sign in can be performed through the /api/sign_in endpoint provided by the API Auth module. The flow should be as follows:

  1. Sign in through POST /api/sign_in
  2. Upload the file through POST /api/blobs
  3. Perform any other API operations normally (e.g. GraphQL mutations)
  4. Sign out through DELETE /api/sign_out

Example implementations can be found from the examples directory which perform this whole flow. Examples are provided for Ruby and Node.js.

Installation

Add the following lines to your application's Gemfile:

gem "decidim-apiauth", github: "mainio/decidim-module-apiauth", branch: "main"
gem "decidim-apifiles", github: "mainio/decidim-module-apifiles", branch: "main"

And then execute:

bundle

And also follow the installation instructions of the API Auth module.

Contributing

See Decidim.

License

This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.

About

API endpoints for uploading and managing file blobs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •