OpenControl API Setup
This section is intended for users who want to demo the API capability or run one of the Mersive supplied Python applications, and assumes no familiarity with general purpose programing. If you are familiar with programming and have a preferred way of sending and receiving HTTP GET and POST commands, jump to the list of commands.
If you simply want to experiment with receiving and sending information via the API, Postman is a great tool that can help you develop an intuitive grasp of the capabilities and workflows of the OpenControl API. Enter the URL of your target host or server and click 'GET' to confirm connectivity with your target and see the results of every key:value set associated with that target.
How To

If you want to run complete scripts and are starting from scratch, follow the comprehensive instructions below.
The following steps assume the use of a Windows operating system and Python version 3.11. If you have a different operating system or are using a different version of Python, you will need to modify the steps to suit your situation.
- Download Python 3.11 from python.org/downloads/.
- Install as close to the main drive as possible. The default location is likely C:\Python311, which is perfect.
- Download get-pip from pip.pypa.io/en/stable/installation/ and move the file into the same folder as your new installation of Python 3.11.
- Open the Windows Command Prompt (CMD).
- Navigate to the Python directory. If you installed in the default location, type:
- If you installed into a different folder, navigate through your file system using
cd [folder name]
to enter a subfolder orcd ..
to move up a level. The commanddir
lists a directory of everything inside the current folder. - Once you’re in the Python folder, type
dir
to verify that get-pip.py is in the folder. - If so, type
py get-pip.py
and wait for pip to install. - Next, install the requests package with the following command:
- Wait for requests to finish installing. Information on this package is available at docs.python-requests.org/en/latest/.
cd C:\Python311\
python -m pip install requests
Once the requests package is installed, you can GET/POST individual messages to or from specific IP addresses directly from the Python terminal window (access by double-clicking the python.exe file), or you can write a Python script in an editor (such as Notepad++) and run the script from PowerShell or the Python terminal window.
While OpenControl API interactions are agnostic to client programming language and version, the examples in this document were written based on the use of Python 2.7 and may need to be modified accordingly.

Now, test that you have network connectivity to a Solstice IP address (Pod or Software Instance) by pinging the IP address. If the IP address is http://192.168.3.127, the shell command would be:
>>> ping 192.168.3.127
Wait for the ping to finish. The result should be 4 packets sent and 4 packets received.

At this point, we recommend downloading and running the example GET script to see all the available options. Download the script from our GitHub repository here and move it to a known location. You can double-click the file to run it immediately, or open it in an editor to modify the script.
Next Topic