B. ip control commands – Muxlab 8 x 8 Cat 5e/6 Line Level Audio Matrix Switch User Manual

Page 41

Advertising
background image

© MuxLab Inc.

Audio 8x8 Matrix Switch Installation Guide

Page 41

B. IP Control Commands

1. Notice
This section is provided for informational purposes only, and should only be used by
software developers with a thorough understanding of the HTTP and JSON
specifications.

2. Introduction

The Matrix Switch can be controlled using basic IP commands. These commands are
based on the JSON format and are sent and received in standard TCP/IP packets. To
learn more about JSON, visit

http://www.json.org

.

Only four types of JSON arrays are used to control the product:

Array of a single integer:

[2]

Array of multiple integers:

[1,2,3,4]

Array of a single string:

[“A Name”]

Array of multiple strings:

[“Name 1”, “Name 2”, “Name 3”, “Name 4”]

Any other notation is not permitted. Also, “null” values are not permitted. Use 0
instead.

3. Basic Usage

All read and write operations are performed via HTTP GET and HTTP POST
commands, respectively. While you can perform a GET at any time, a POST
command will require prior authentication.

4. Basic Authentication

Authentication is performed in two simple steps:

1. Obtain a Session ID

Perform a GET request on /var/session.json to obtain a new session ID. The return value
will be a JSON array of a single integer, for example [12345]. From then on, simply
append the session to any new IP requests to use this session, e.g., GET
/var/conn.json?sid=12345

2. Obtain Credentials for that Session ID

There are three permission levels that can be used to read/modify properties. These are:

0 – Guest: Can read all values. Cannot write or make changes.

1 – User:

Same as Guest, but can change matrix video connections.

2 – Admin: Can perform any command without restriction.

To obtain credentials, you will need to POST an array of two strings to /var/auth.json: the
userlevel, and the password associated to that user. For example:

POST /var/auth.json?sid=12345

POST data: [“2”, “mypassword”]

Advertising