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" - Лимит на одновременные подключения.
    "ip": "" - user ip address.
    "packages": ["ALL"] - Channel package 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": "a01h","stream": {"id":"a01h","name":"test","enable": true, "type": "spts","input": ["udp://], "output": ["http://0:8078/fox"] } }' http://login:pass@tv.server.ip:port/control/

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