API usage examples

    Counting the number of hls/http sessions:

    curl -s -X POST -d '{ "cmd": "sessions" }' http://login:pass@tv.server.ip:port/control/|grep client_id|wc -l

    Switching input:
    (For example , turning off the channel with erotic content in the daytime)

    curl -X POST -d '{"cmd":"set-stream-input", "id":"a006","input":2}' http://login:pass@tv.server.ip:port/control/

    a006 - stream id, "input":2 - input number. The numbering of the inputs begins with one.

    Create user:

    curl -X POST -d '{"cmd": "set-user", "id": "user6541", "user": {"enable": true, "type": 3, "password": "user6541",  "conlimit": "5", "ip": "", "packages": ["ALL"] }}' http://login:pass@tv.server.ip:port/control/

    "id": "user6541" - User login. Is the user id.
    "enable": true - User is active.
    "type": 3 - User group. (1 - administrator, 2 - observer, 3 - user)
    "password": "user6541" - user password
    "conlimit": "5" - Limit on simultaneous connections.
    "ip": "" - User's ip address.
    "packages": ["ALL"] - A package of channels available to the user.

    Get user configuration:

    curl -X POST  -d '{"cmd": "get-user", "id": "user6541"}' http://login:pass@tv.server.ip:port/control/

    user6541 - user login.

    Create/edit stream:

    curl -X POST -d '{"cmd": "set-stream","id":"a005","stream": {"id": "a005","type": "spts","input": ["udp://"],"http_keep_active": "-1","name": "test","enable": true,"output": ["http://0:555/fox"]}}' http://login:pass@tv.server.ip:port/control/

    "name":"test" - stream name
    "id": "a01h" - stream id