Web Server REST API - PUT Clip By ID Transport Position

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
NEWP_Official
Met Resolume in a bar the other day
Posts: 11
Joined: Sat Aug 05, 2017 20:20

Web Server REST API - PUT Clip By ID Transport Position

Post by NEWP_Official »

Hey hivemind. I can use Touch Designer's Web Render Top and Web Client Dat to GET and POST Rest API commands like get thumbnail and connect clip by ID. I would like to update the Transport Position of a Clip by Clip ID. I would expect the following to work:

op("REZQ_1_PostOut").request('http://127.0.0.1:8080/api/v1/compositio ... d/<clip_id>', 'PUT', data={'transport': {'position': {'value': float(op("REZQ_1_PostRange")[0])}}})

to work, however I am getting a "JSON parse error: 'Invalid value.' (offset:2)" data response

so i then try:

op("REZQ_1_PostOut").request('http://127.0.0.1:8080/api/v1/compositio ... d/<clip_id>', 'PUT', data={'position': float(op("REZQ_1_PostRange")[0])})

and I get a "JSON parse error: 'Invalid value.' (offset: 0)


I even then tried doing something along the lines of:
jsonData = {
"transport": {
"position": {
"value": float(op("REZQ_1_PostRange")[0])
}
}
}
jsonData = json.loads(jsonData)

#op("REZQ_1_PostOut").request('http://127.0.0.1:8080/api/v1/compositio ... d/<clip_id>', 'PUT', data=jsonData)



to no avail. How should I update a clip timeline position with the Web Server Rest API?

NEWP_Official
Met Resolume in a bar the other day
Posts: 11
Joined: Sat Aug 05, 2017 20:20

Re: Web Server REST API - PUT Clip By ID Transport Position

Post by NEWP_Official »

Solved my PUT JSON request by formatting my Python Dictionary with json.dumps() as well as declaring the contentType to be 'application/json' in my web client dat request() call

Post Reply