Problems with API: Text parameter of Text Animator

Post your questions here and we'll all try to help.
Post Reply
tkmedia
Posts: 1
Joined: Fri Dec 10, 2021 16:38

Problems with API: Text parameter of Text Animator

Post 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)
Attachments
298583103_5369758876402990_182834159795882548_n.jpeg
298583103_5369758876402990_182834159795882548_n.jpeg (8.67 KiB) Viewed 6894 times
298668623_5369759733069571_8399315683909172199_n.jpeg

pcholas
Posts: 1
Joined: Mon Oct 31, 2022 10:42

Re: Problems with API: Text parameter of Text Animator

Post by pcholas »


martijn
Team Resolume
Posts: 5
Joined: Wed Nov 25, 2020 09:01

Re: Problems with API: Text parameter of Text Animator

Post 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.

dmtelf
Posts: 4
Joined: Tue Feb 18, 2014 17:17

Re: Problems with API: Text parameter of Text Animator

Post 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?

Zoltán
Team Resolume
Posts: 7483
Joined: Thu Jan 09, 2014 13:08
Location: Székesfehérvár, Hungary

Re: Problems with API: Text parameter of Text Animator

Post by Zoltán »

Not sure,
copy pasted your command, and it works fine for me:
Képernyőfotó 2024-11-19 - 10.54.45.png
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

dmtelf
Posts: 4
Joined: Tue Feb 18, 2014 17:17

Re: Problems with API: Text parameter of Text Animator

Post 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.
Resolume JSON parse error.PNG

martijn
Team Resolume
Posts: 5
Joined: Wed Nov 25, 2020 09:01

Re: Problems with API: Text parameter of Text Animator

Post 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.

Post Reply