StreamElements / api-docs

7 stars 3 forks source link

Adding text to widget #6

Open Strooss opened 7 months ago

Strooss commented 7 months ago

What is the endpoint (how) to add a text to a widget

c4ldas commented 7 months ago

There isn't an endpoint to add a text to a widget. You would need to get the current overlay and all widgets in there, and send the whole information with the modification to the overlay again.

1 - Get the ID of the overlay you want to change from your overlay list https://dev.streamelements.com/docs/api-docs/b642d46bee583-channel

2 - Get the details of your specific overlay https://dev.streamelements.com/docs/api-docs/af02de52998ec-channel-overlay-id

3 - Modify what you want from the code you obtained from step above and send it back (Same endpoint as above, but using PUT request) Send the whole overlay information (with your modified data) as the body of the request https://dev.streamelements.com/docs/api-docs/af02de52998ec-channel-overlay-id

4 - Reload the overlay (this is optional) https://dev.streamelements.com/docs/api-docs/8727ec48e284e-channel-reload

If you want to do it via websocket, send the body to overlay:update, like:

socket.emit('overlay:update', entireOverlayModified)

I would recommend that you try it in a test overlay to see how it works, in order not to corrupt your original one.