Home AMX User Forum AMX Technical Discussion

Haivision HTTPS/POST commands with API Key

Hello all. I've been getting back into AMX Programming after sporadic projects over the past couple of years, and I have a big project using a Haivision video wall processor. I need to send routing commands to this thing, which thankfully can be pretty much anything for the specific commands. That said, they must be sent using HTTPS as a POST command, using an API key. I've only done POST commands once in the last 20+ years with another product, and it was immeasurably painful. Haivision themselves have been helpful to an extent, but they have zero experience formatting a POST command with AMX, or even really how the things are formatted in general. The notes i've gotten from them say the command should be formatted like (example):

local url = "https://manager.command360.org/Haivision/NetworkManager/RoomService/Public/BehaviorByXref/Alpha1Layout1/start"

Where 'manager.command360.org' is the URL for the controller, and i'm guessing most of the rest of the string is the location of the commands, of which 'Alpha1Layout1' would be the name of the layout to load.

Then some info about what I can assume is the header, like:

local headers =
["x-haivision-api-token"] = "(Blah Blah long API Token Hash code)",
["Content-Type"] = "application/json"

There's undoubtedly some piece of the header where I also would have to calculate the length of the string and include it as part of the header. I had to do that before. I get the feeling this is missing pieces of the header/etc that i'd need to build and send in order to achieve success, but don't understand enough about POST command formatting to know for sure,no matter what I read on various forums, posts, etc.

I have had trouble finding good examples of POST commands in AMX, or for that matter... Understanding the few things i've found. Can someone point me in the right direction and help decypher how this would be done in AMX? There's a DUET module for another Haivision piece, but I'm not sure it uses an API token or similar path/etc. Would love it if I could just use it and just PASSTHRU the commands.

Any help is greatly appreciated.

Comments

  • Here's a little basic http POST sample. Comments are in German, sorry :smile:
    As the post sample doesn't contain the IP Client handling, find also attached a basic IP client handling.

    The post sample shows how to transfer json, so you will find the Content-Type for the post header. You may have to add your x-haivision-api-token in the same matter to the header.

    As Post send its data in the content section, you have to calculate the length of the content. This is shown in the sample.

    Hope this helps to go in the right direction.

Sign In or Register to comment.