Home › Forums › V-Control General › How to connect to JSON API
- This topic has 4 replies, 2 voices, and was last updated 3 years, 6 months ago by
JonasStade.
-
AuthorPosts
-
July 19, 2019 at 19:26 #6826
JonasStade
ParticipantHey boys and girls,
I am trying to connect to the Pixera API. There are two different routes to do that, first I can connect via TCP/JSON and second I can use HTTP, but the recommended way would be JSON. There is an API documentation, but I am not sure how to handle it in V-Control.
I tried to send this string via tcp generic device to the API Port, but nothing comes back from it.
pxr1]…{“jsonrpc”:”2.0″,”id”:46,”method”:”Pixera.Timelines.getTimelineAtIndex”,”params”:{“index”:1}}
If someone has an idea how to do this in V-Control, please comment below 🙂
The documentation is also availible in this tread!
Attachments:
July 19, 2019 at 19:27 #6828JonasStade
Participantsomething went wrong with the pdf file, here we go again 😉
Attachments:
July 20, 2019 at 02:15 #6837Dierk
ParticipantUhi, had just had a quick look and think that’s not soooo simple.
What interface are you using on Pixera side?
JSON/TCP
HTTP/TCP
Binary/TCPare there different ports for every interface?
Sending the Json string should be quite simple, even if the compilation of a string with many ” is not so convinient.
I’m working on Json support. In 4.1.5 there is a first step of this approch helping you to get values of received Jason strings. You can take a look at the new AJA FS_HDR driver for example.The new Json command is explained here
https://v-control.com/wiki/doku.php/compiler#getjsonvalueUnfortunately I’m very busy these days. If It’s not to urgend and you have access to a Pixera Server, I sugest that you visit me with that device and we try together.
July 20, 2019 at 20:16 #6857JonasStade
ParticipantHi Dierk,
Pixera can be downloaded as a demo version and the api is working on that. So I tried it for a longer time yesterday and found a JSON client for API Testing which works very well. Is quit simple, I am using the HTTP Port on 8080 (own choice) and also have activated the Port 1400 for JSON TCP. You can use two API Ports at the same time and two Output Ports for sending something back from the timeline. They have also a JSON DL with delimiter Px0X ehich you can use. But for now the HTTP work. The thing is, you have to send the command as RAW. In the Software I just fill out the body part with the command and send it as RAW and get a RAW back from the API.
But if you have some time, it would be also nice to visit your place for a nice talk 🙂
July 22, 2019 at 12:46 #6899JonasStade
ParticipantHi Dierk,
I found the mistake on the whole thing:
ÄzÌJ:àLhE{1Ú@ÂDã_ÐAÚØP?ºPOST / HTTP/1.1
Content-Type: text/plain
User-Agent: PostmanRuntime/7.15.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 4b243b39-1067-43a9-a23a-1deee3587f13
Host: 10.20.21.10:8080
accept-encoding: gzip, deflate
content-length: 68
Connection: keep-alive{"jsonrpc":"2.0", "id":20, "method":"Pixera.Screens.getScreenNames"}
ÄzÌJ:àLhE6"@
Â\>¸:üdßúP?ÜPOST / HTTP/1.1
Content-Type: text/plain
User-Agent: V-Control/4.1.5
Accept: */*
Cache-Control: no-cache
Postman-Token: 66197b73-b76d-442f-be13-1c43b56ffbfc
accept-encoding: gzip, deflate
content-length: 68
Connection: keep-alive
{"jsonrpc":"2.0", "id":20, "method":"Pixera.Screens.getScreenNames"} HTTP/1.0
Accept: */*
Accept-Language: en
Host: 10.20.21.10
So there are some points on that. First fact that you should have known as a programer, vcontrol adds this part BEHIND the command.
Accept: */*
Accept-Language: en
Host: 10.20.21.10But it seems not relevant for the whole thing.
The most important thing on pixera is Content-Length!! This defines the command lenght and when you leave that out, it sais “Request has no data.”. This is something you have to know and its very reverse engineered from me 🙂
So it works now and I will upload the driver, when its ready 😉
-
AuthorPosts
- You must be logged in to reply to this topic.