With OBS Raw, you can send raw JSON requests directly to the OBS WebSocket connection, allowing you to make any OBS requests that are not already available as first-class sub-actions
To use variables in the JSON request, add the % variable surrounded by quotes, it must still be valid JSON to parse properly. The variable will be auto-typed when it is parsed to be sent to OBS, so if the variable is a number, the resulting JSON will not have double quotes around the value.
When the OBS Raw is executed, result will be places in the argument stack for the action.
Since the result is returned in JSON, it will walk the entire tree, and add each value as a obsRaw.<JSON Path>
for use.
A special obsRaw._json
will also be added, which is the entire JSON as a string, this is mainly for use in C# where you can deserialize this into an object for easier access/traversal.
The raw code is in JSON
and you need to follow the list of Requests, and put those request fields in the requestData
object.
In the preview you see your raw code visually.
When you have clicked on the Test
button you will see all the Response Fields/Variables.
Here you see one parameter, Add results to arguments
.
When enabled, Streamer.bot will treat your Result
as variables, by default this is turned on.
Give this a name to sort it between the other sub-action (for example you can use your request type).
This will be in front of your variables when an action has ran.
Using this button your raw code will automatticly be JSON formatted.
This will test the raw code, but this won't run the action/sub-action in any way.
You can change between obs connections, more for advanced users.
{
"requestType": "request method",
"requestData": { ... }
}
You can use this offical OBS raw generator by Streamer.bot
Or you can find all the request fields on the OBS raw Requests page