SuperFlyTV/SuperConductor

HTTP API query example

norum666 opened this issue · 1 comments

Hi everyone,

first of all, I must say SuperConductor is very good and very usable product, with powerful set of functionalities, also intuitive, easy to learn and pleasant to work with.

That being said, I was wondering if someone can give some examples for using HTTP api requests. Simple stuff, like stop a group, start a group, stop a part, start a part, etc. I tried to do it, but it is not documented to this level, so I didn't succeed.

If somebody did try this, can you write an URL example how to start Group1 inside Rundown1, or start Part1 inside Group1 inside Rundown1

Thanks everyone,
Roman

Hi Roman, thanks for this issue! You're right that this needs documenting.

For starters, here is how to play a Part:

POST http://localhost:5500/api/internal/playPart/?rundownId=default.rundown.json&groupId=3s3YxfhQ&partId=x3eGFRSu

The groupId and partId can be grabbed via the UI by clicking on that Group or Part and then clicking on its ID in the right pane, which will copy it to your clipboard.

To analyze the shape of the internal API (i.e. to determine what the query parameters are), you need to look at the arguments provided to each public method in IPCServer.ts.

For example, https://github.com/SuperFlyTV/SuperConductor/blob/master/apps/app/src/electron/IPCServer.ts#L380 shows the function signature for playPart, which demonstrates that it takes three required parameters: rundownId, groupId, and partId. Therefore, these are the query params which must be provided in the /playPart POST request.

At one point I was changing this API to use JSON body payloads instead of query param strings, but that appears to not be in the latest release and maybe I never finished that work. I was doing that work because there are some structures that cannot be represented as query strings, and some of the API methods need those structures. I can't recall which. Hopefully you don't need those to get your idea off the ground 😅

Hope this helps and feel free to ask further clarifying questions!

Great, got it, I will try! Thanks so much!

Roman