edemaine / cocreate

Cocreate Shared Whiteboard/Drawing
MIT License
209 stars 27 forks source link

API for creating rooms? #49

Closed adqm closed 4 years ago

adqm commented 4 years ago

Is there a way to programmatically create a new room via an external API?

I was hoping to be able to send a request to the root URL and then see a 301 or something like that to figure out what new room had been created, but (duh!) everything is being handled in Javascript, so I don't see much of anything if I just curl the URL.

The use case I'm thinking about is the help catsoop help queue system. This past term, we had the system auto-generate video chat links for students and staff to use to connect, by generating a unique link per queue entry, that we could share with both parties to connect them. I'm imagining something similar for cocreate: I'd like to be able to send a request to somewhere to create a new room and get back its ID, which I could then use to show the same room to both parties in the queue. Is that doable?

I'm happy to dip my toes into the code and try to implement it, too, but I'm not at all familiar with Meteor, so it might take some time, and I might need some mentoring :)

edemaine commented 4 years ago

This doesn't exist yet, but I was thinking about it recently because you mentioned it last we met. There is a way to do this in Meteor, called WebApp. Here's some example code from Coauthor (for a much more complicated setting of downloading an uploaded file, with various permission checks and continuation options and so on).

In this way, I think it should be pretty easy to make an /api/roomNew path this way, e.g. adding a file /server/api.coffee. Do you want to try your hand at it? If not, I can do it.

adqm commented 4 years ago

Sure, I'm happy to give it a shot (and thanks for the pointers!). Seems like it be an easy way to dip my toes in a little bit. Probably won't be tonight, but hopefully there's no real rush here.

edemaine commented 4 years ago

Solved by #51