I’m experiencing some trouble with the new Resolume REST API.
I’m trying to set the text of a “Text Animator” by using the PUT method, but it doesn’t seem to change the text. I’m using the built in “Swagger UI” to test my commands, but I can’t get it to work.
The weird thing is, I’m able to set other parameters (like for example “Animated Position X”).
The way I’m trying to get it work is by first using the GET command to get the right clip.
localhost:8080/api/v1/composition/layers/2/clips/1
This results into this JSON data: https://pastebin.com/2wnMFkqC
After that I’ve stripped the excess data and shrunk it down to this: https://pastebin.com/pEAPkjSh
I’ve got a 204 response from Resolume so no syntax errors etc.
Does anyone have any idea what I’m doing wrong?
Thanks a lot!!
(Using the latest Resolume at this moment: 7.13.1)
Problems with API: Text parameter of Text Animator
Re: Problems with API: Text parameter of Text Animator
There some missing in API.
https://resolume.com/forum/viewtopic.php?p=86248#p86248
https://resolume.com/forum/viewtopic.php?p=86248#p86248
Re: Problems with API: Text parameter of Text Animator
Right, this is definitely a bug! The example from the Swagger UI should absolutely work, so I'll look into fixing this. In the meanwhile, the request works when you omit the "value" from the object, so instead of doing this:
which should work, but doesn't, you can do this:
which does work.
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/2/clips/5 -d '{"video":{"sourceparams":{"Text":{"value": "Resolume 313"}}}}'
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/2/clips/5 -d '{"video":{"sourceparams":{"Text": "Resolume 313"}}}'
Re: Problems with API: Text parameter of Text Animator
I'm a Resolume API newbie & I am struggling to change text in a Text Block via CURL.
Resolume 7.21.3 rev 38686 is webserver enabled & built-in example HTML deck is working in Chrome.
I put a Text Block in layer 1 clip 1 in the first deck of my composition & enter the following in a DOS command line (using martijn's 2nd example above):
I get the below error & I don't understand why as all the curly brackets have got a } too:
Where am I going wrong?
Resolume 7.21.3 rev 38686 is webserver enabled & built-in example HTML deck is working in Chrome.
I put a Text Block in layer 1 clip 1 in the first deck of my composition & enter the following in a DOS command line (using martijn's 2nd example above):
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/1/clips/1 -d '{"video":{"sourceparams":{"Text": "I Love Resolume"}}}'
Code: Select all
JSON parse error: 'Invalid value.' (offset: 0)curl: (3) unmatched close brace/bracket in URL position 16:
I Love Resolume}}}'
Re: Problems with API: Text parameter of Text Animator
Not sure,
copy pasted your command, and it works fine for me: Are you sure you have Resolume 7.21.3 ?
copy pasted your command, and it works fine for me: Are you sure you have Resolume 7.21.3 ?
Software developer, Sound Engineer,
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu
Control Your show with ”Enter” - multiple Resolume servers at once - SMPTE/MTC column launch
try for free: http://programs.palffyzoltan.hu
Re: Problems with API: Text parameter of Text Animator
Weird. I confirm the version number. Just tried again via copy'n'paste & I still get same JSON parse error, as shown in the screenshot.
Re: Problems with API: Text parameter of Text Animator
I was able to reproduce this, but only if I use the Windows Command Prompt. It seems that it thinks some of the double quotes inside the JSON is the end of the input.
The easiest solution is to use another shell, but if you must use Windows Command Prompt, you can instead do it like this:
On other shells, the outer single quotes mean that the double quotes inside the JSON are left as-is, while with Windows Command Prompt it just gets confused. You can escape the double quotes inside the JSON by repeating them, and switching the single quotes around the JSON to a single double quote.
The easiest solution is to use another shell, but if you must use Windows Command Prompt, you can instead do it like this:
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/1/clips/1 -d "{""video"":{""sourceparams"":{""Text"":""I Love Resolume""}}}"