Page 1 of 1
Problems with API: Text parameter of Text Animator
Posted: Wed Aug 10, 2022 12:24
by tkmedia
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)
Re: Problems with API: Text parameter of Text Animator
Posted: Mon Oct 31, 2022 10:44
by pcholas
Re: Problems with API: Text parameter of Text Animator
Posted: Tue Oct 31, 2023 13:19
by martijn
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:
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/2/clips/5 -d '{"video":{"sourceparams":{"Text":{"value": "Resolume 313"}}}}'
which
should work, but doesn't, you can do this:
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/2/clips/5 -d '{"video":{"sourceparams":{"Text": "Resolume 313"}}}'
which does work.
Re: Problems with API: Text parameter of Text Animator
Posted: Mon Nov 18, 2024 14:31
by dmtelf
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):
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/1/clips/1 -d '{"video":{"sourceparams":{"Text": "I Love Resolume"}}}'
I get the below error & I don't understand why as all the curly brackets have got a } too:
Code: Select all
JSON parse error: 'Invalid value.' (offset: 0)curl: (3) unmatched close brace/bracket in URL position 16:
I Love Resolume}}}'
Where am I going wrong?
Re: Problems with API: Text parameter of Text Animator
Posted: Tue Nov 19, 2024 10:54
by Zoltán
Not sure,
copy pasted your command, and it works fine for me:
Are you sure you have Resolume 7.21.3 ?
Re: Problems with API: Text parameter of Text Animator
Posted: Tue Nov 19, 2024 19:34
by dmtelf
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
Posted: Wed Nov 20, 2024 16:58
by martijn
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:
Code: Select all
curl -X PUT http://localhost:8080/api/v1/composition/layers/1/clips/1 -d "{""video"":{""sourceparams"":{""Text"":""I Love Resolume""}}}"
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.