Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
267 stars 43 forks source link

Feature Request: REST API for GET / POST Requests #139

Open iotemylabs opened 1 month ago

iotemylabs commented 1 month ago

Hi!

First of all, this project has been a joy to use. I remember making my own version back in college years ago in a rudimentary fashion, but this is way better built. Kudos!

What I wanted to do is to have each user have an API Key given from the Admin, and to be able to POST Links to Christmas Community assigned to the user's API Key to POST links and Christmas Community can get the product data.

This is also helpful if Christmas Community could also GET the list in a JSON format, allowing for us in either the NodeRED and Home Assistant community to use it to extend functionality beyond Christmas Community.

My example: I use Hoarder as my self-hosted bookmark manager. I built NodeRED Flows to utilize Hoarder's CLI and tRPC API to send each bookmark's url to another service in my homelab (Such as Mealie for Recipes).

My thought was is using a similar flow to add to a wishlist in Christmas Community, and to also read lists and individual items.

Thank you!

Wingysam commented 1 month ago

Yeah that's a great idea! I can add some endpoints and Swagger docs to it.

Then we'll need a way for the users to create their tokens. Do you need a way for the admin to make a super-token that can control everyone's data?

I do plan to make breaking changes to the wishlist structure in the future, so the API will be documented as unstable and as time goes on and I change how it works you'll need to redo your usage of it.